[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to generate different name using the same rule.
HI All, I am in a seriuos problem , I have template rule which will be called from variuos rule , the problem I face is for the same rule being called it should generate different names as per sequence , to be precise In the below xsl rule condition is called by locations & products when it is called by locations the select should have a name like loc-qual-1 , loc-qual-2 , etc.. the same when called by products it should generate prod-qual-1, prod-qual-2 etc.. thanks on advance. sivaji here is the xml : <restrictions> <prodlist> <products> prod1 </products> <products> prod2 </products> <products> prod3 </products> <products> prod4 </products> </prodlist> <locations> <condition> <places> <place> subtree </place> <place> node </place> <place> childof </place> </places> <qualifiers> <qualifier> is </qualifier> <qualifier> has </qualifier> <qualifier> has not </qualifier> </qualifiers> </condition> <condition> <places> <place> subtree </place> <place> node </place> <place> childof </place> </places> <qualifiers> <qualifier> is </qualifier> <qualifier> has </qualifier> <qualifier> has not </qualifier> </qualifiers> </condition> </locations> <products> <condition> <places> <place> subtree </place> <place> node </place> <place> childof </place> </places> <qualifiers> <qualifier> is </qualifier> <qualifier> has </qualifier> <qualifier> has not </qualifier> </qualifiers> </condition> <condition> <places> <place> subtree </place> <place> node </place> <place> childof </place> </places> <qualifiers> <qualifier> is </qualifier> <qualifier> has </qualifier> <qualifier> has not </qualifier> </qualifiers> </condition> </products> </restrictions> and the xsl is <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method = "html"> <xsl:template match="/"> <html> <head></head> <title>Panopticon2</title><LINK rel="stylesheet" href="report.css" type="text/css" /> <body bgcolor="#FFFFFF" text="#000000" link="#CC3333" vlink="#CC3333" alink="#FFFFFF"> <p/><br/> <a href="/"><img src="logo150.gif" width="150" height="21" vspace="2" class="PageHeader" border="0" /></a> <p/> <h3><b><center>Product Display Restrictions</center></b></h3> <p/> <form action="nothing"> <xsl:apply-templates /> <br/><br/><p/> <hr/><br/> <center> <input type="button" value="Change Rule" /> </center> </form> </body> </html> </xsl:template> <xsl:template match="prodlist"> <center> <!--<h3>Rules:</h3><br/>--> <select name="products" size = "5" > <xsl:for-each select="products" > <option value = "{normalize-space()}"> <xsl:value-of select="."/> </option> </xsl:for-each> </select> <br/><br/> <input type="button" value="Add" /> <input type="button" value="Delete" /> </center> </xsl:template> <xsl:template match="locations"> <p/> <hr/> <table> <tr> <td><b>Within locations matching</b></td> <td><input type="radio" name="loc" value="any" /><b><i> any</i></b></td> <td><input type="radio" name="loc" value="any"/><b><i> all</i></b></td> <td><b> of the following: </b></td> </tr> </table> <center> <xsl:apply-templates /> <input type="reset" value="Add Condition" /> <input type="button" value="View Selected" /> </center> </xsl:template> <xsl:template match="products"> <p/> <hr/> <table> <tr> <td><b>show prodcuts matching</b></td> <td><input type="radio" name="loc" value="any" /><b><i> any</i></b></td> <td><input type="radio" name="loc" value="any"/><b><i> all</i></b></td> <td><b> of the following: </b></td> </tr> </table> <center> <xsl:apply-templates /> <input type="reset" value="Add Condition" /> <input type="button" value="View Selected" /> </center> </xsl:template> <xsl:template match ="condition"> <table border="0"> <tr><td> <select name="places"> <xsl:for-each select="places/place" > <option value = "{normalize-space()}"> <xsl:value-of select="."/> </option> </xsl:for-each> </select> </td><td> <select name="qualifiers" > <xsl:for-each select="qualifiers/qualifier" > <option value = "{normalize-space()}"> <xsl:value-of select="."/> </option> </xsl:for-each> </select> </td> <td> <input type="text" size="20" value="Flowers Cards" name="text" /></td> <td><input type="button" value="Browse" /></td> <td><input type="button" value="Delete" /></td> </tr></table> </xsl:template> </xsl:output> </xsl:stylesheet> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|