This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Select each child node
- To: "XSL Mailing List \(E-mail\)" <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] Select each child node
- From: "Tim Watts" <timw at 3d3 dot com>
- Date: Wed, 2 May 2001 10:06:18 +1000
- Reply-To: xsl-list at lists dot mulberrytech dot com
How would I go about selecting each child node of an element to be printed?
If I had a XML
<root>
<stats>
<stat>
<element1>value<element1>
<element2>value<element2>
<element3>value<element3>
<element4>value<element4>
</stat>
<stat>
<element1>value<element1>
<element2>value<element2>
<element3>value<element3>
<element4>value<element4>
</stat>
</stats>
</root>
that the XSLT would print out each value of the nodes.
In pidgin XSLenglish it would be like...
<tr>
<xsl:apply-templates select="stat" />
</tr>
...
<xsl:template match="stat">
For each element, what-ever the element name
<td>
<xsl:value-of select="." />
</td>
Run through each element until done.
</xsl:template>
Thanks for your help with this xpath question... :)
Tim
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list