This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How nested for loop in xsl?
- To: xsl-list at mulberrytech dot com
- Subject: Re: How nested for loop in xsl?
- From: Nick Browne <NickBrowne at slipstone dot co dot uk>
- Date: Wed, 20 Sep 2000 12:26:42 +0100
- Organization: Slipstone Ltd
- References: <C11D67DC0A77D311BEA5009027B1008C34AC74@ATMMS1>
- Reply-To: xsl-list at mulberrytech dot com
This creates the output you requested though it does not look like a
particularly generic solution. I suspect there may be more meaning to your
input/output structures that is not apparent from the sample given.
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<name>
<xsl:apply-templates select="sqlgeneral/*"/>
</name>
</xsl:template>
<xsl:template match="productA">
<xsl:for-each select="./row/name">
<item><xsl:value-of select="."/></item>
</xsl:for-each>
</xsl:template>
<xsl:template match="productB">
<xsl:for-each select="./row/code">
<type><xsl:copy-of select="."/></type>
</xsl:for-each>
</xsl:template>
Regards
Nick Browne
Slipstone Ltd
jvhew@asiatravelmart.com wrote:
> hi,
>
> I'am new in xsl and hope somebody can help me on this.
> I'll like to transform the below input.xml file to
> output.xml using the specify xsl file
etc.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list