Page 1 of 1

value-of without content of child elements

Posted: Sun Jun 26, 2005 2:03 pm
by ally
Hi everybody!

With xslt:value-of I get the content of the actual element and the content of all its child elements. Is there a possibility to get only the content of the actual element without the children's content?

Thanks in advance,
ally

Posted: Mon Jun 27, 2005 9:47 am
by george
Hi,

In order to get all the text nodes inside an element you need to iterate through them, one possibility will be with something like below, assuming the current node is the desired element:

Code: Select all


<xsl:for-each select="text()">
<xsl:value-of select="."/>
</xsl:for-each>
</code]

Best Regards,
George