[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Select each child node

Subject: RE: Select each child node
From: "Tim Watts" <timw@xxxxxxx>
Date: Wed, 2 May 2001 10:49:05 +1000
xslt for each child
Of course - simply use <xsl:for-each select="child::node()">

Sorry to bother you all :)

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Tim Watts
Sent: Wednesday, 2 May 2001 10:06 AM
To: XSL Mailing List (E-mail)
Subject:  Select each child node


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

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.