View Full Version : I don't understand the interaction of xsl:for-each and xsl:value-of

12-15-2002, 05:20 AM
Say I've got really simple xml:

<para>some text in paragraph 1</para>
<para>some text in paragraph 2</para>
<para>some text in paragraph 3</para>

And what I want to do is:

<xsl:for-each select="webpage/para">
<xsl:value-of select="para" />

But of course it doesn't work - there's no <para> inside <para> to get the value of !

I'm obviously failing to grasp something fundamental ... ??

12-15-2002, 04:30 PM
Inside the for-each, the para element is now the context node.


<xsl:value-of select="."/>


12-15-2002, 04:53 PM
Simple as that ... That clears it up nicely. Thanks :thumbsup:

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum