Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iterate nodes

Status
Not open for further replies.

magmo

Programmer
May 26, 2004
291
SE
Hi


I have a xml file that looks like this..

<books>
<book id="1">
<name>Book 1</name>
<author>Me</author>
<book>
<book id="2">
<name>Book 2</name>
<author>You</author>
<book>
</books>



I want to iterate through all <book> items, and inside this loop be able to write out the <name> & <author> values.



Could anyone show me how to do this in vb.net?

Regards
 
Read this tutorial



and then you can use the following xsl:

Code:
...
<xsl:template match="//books">
    <xsl:apply-templates select="book"/>
</xsl:template>

<xsl:template match="book">
    <xsl:value-of select="name"/> <xsl:value-of select="author"/>
</xsl:template>
...

.. there is such a thing as google you know.

good luck

m
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top