[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Plse Help! something to do with counter....
Thanks for your reply. I tried to change the codes to fit into my XSL but
failed. This is my XSL..
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html><body> <form method="GET" action="../servlet/takeLoan"> <xsl:for-each select="List/Resource"> <div align="right"> <xsl:call-template name="checkboxes"> <xsl:with-param name="max" select="'5'" /> </xsl:call-template> </div><br/> </xsl:for-each> </form> </body></html> </xsl:template> <xsl:template name="checkboxes"> <xsl:param name="count" select="0" /> <xsl:param name="max" select="1" /> <xsl:if test="$count < $max"> <input type="checkbox" name="{Index}" value="c{$count}" /> <xsl:call-template name="checkboxes"> <xsl:with-param name="count" select="$count + 1" /> <xsl:with-param name="max" select="$max" /> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> and my resulting output in html look like this: <html> <body> <form action="../servlet/takeLoan" method="GET"> <div align="right"> <input value="c0" name="1" type="checkbox"> <input value="c1" name="1" type="checkbox"> <input value="c2" name="1" type="checkbox"> <input value="c3" name="1" type="checkbox"> <input value="c4" name="1" type="checkbox"> </div> <br> <div align="right"> <input value="c0" name="6" type="checkbox"> <input value="c1" name="6" type="checkbox"> <input value="c2" name="6" type="checkbox"> <input value="c3" name="6" type="checkbox"> <input value="c4" name="6" type="checkbox"> </div> <br> <div align="right"> <input value="c0" name="8" type="checkbox"> <input value="c1" name="8" type="checkbox"> <input value="c2" name="8" type="checkbox"> <input value="c3" name="8" type="checkbox"> <input value="c4" name="8" type="checkbox"> </div> <br> <div align="right"> <input value="c0" name="9" type="checkbox"> <input value="c1" name="9" type="checkbox"> <input value="c2" name="9" type="checkbox"> <input value="c3" name="9" type="checkbox"> <input value="c4" name="9" type="checkbox"> </div> <br> <div align="right"> <input value="c0" name="10" type="checkbox"> <input value="c1" name="10" type="checkbox"> <input value="c2" name="10" type="checkbox"> <input value="c3" name="10" type="checkbox"> <input value="c4" name="10" type="checkbox"> </div> <br> </form> </body> </html> there will be 5 sets of c0-c4.. what should i do to make it to be like this?(taking max as a constant with a value of 5) <html> <body> <form action="../servlet/takeLoan" method="GET"> <div align="right"> <input value="c0" name="1" type="checkbox"> </div><br><div align="right"> <input value="c1" name="6" type="checkbox"> </div><br><div align="right"> <input value="c2" name="8" type="checkbox"> </div><br><div align="right"> <input value="c3" name="9" type="checkbox"> </div><br><div align="right"> <input value="c4" name="10" type="checkbox"> </div><br></form> </body> </html> Thanks for all the help! From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Reply-To: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> To: "Poh Justin KT" <nitsujpoh@xxxxxxxxxxx> CC: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Plse Help! something to do with counter.... Date: Mon, 30 Apr 2001 09:21:51 +0100
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
|