[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Looping a node in XSLT
Senthilkumaravelan Krishnanatham wrote:
I have tried the same and hard time figuring out the syntax. Considering your code piece below, you will never be able to run it, because it contains compile time errors. If you copied my example, you could've figured out the syntax: 1 to $n instead of: 1to$n Other things in your code that worry me a bit is why you use a call-template for something that only selects all the text nodes from the input, this can be refactored away. There is no matching template for "customer", is that on purpose? I can recommend you the XSLT books by Michael Kay and the beginners book by Jenni Tennison, they provide excellent coverage of some of the key concepts of XSLT (which is to many of us a not-so-trivial language to grasp when we first try it). Something like this perhaps does what you want: <xsl:template match="products"> <xsl:copy><xsl:template select="customer" /></xsl:copy> </xsl:template> <xsl:template match="customer"> <xsl:copy-of select="for 1 to 10 return ." /> </xsl:template>
|
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
|