Subject: Re: [xsl] Looping a node in XSLT From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 07 Mar 2007 01:23:35 +0100 |
I have tried the same and hard time figuring out the syntax.
<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>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes" encoding="UTF-8" />
<xsl:template match="/products">
<xsl:copy>
<xsl:call-template name="COPY">
</xsl:call-template>
</xsl:copy>
</xsl:template>
<xsl:template name="COPY">
<xsl:variable name="n" select="10" />
<xsl:for-each select="1to$n">
<xsl:copy>
<xsl:apply-templates select="//customer/*"/>
</xsl:copy>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Looping a node in XSLT, Senthilkumaravelan K | Thread | Re: [xsl] Looping a node in XSLT, Senthilkumaravelan K |
Re: [xsl] Looping a node in XSLT, Senthilkumaravelan K | Date | Re: [xsl] Looping a node in XSLT, Senthilkumaravelan K |
Month |