value-of without content of child elements

Here should go questions about transforming XML with XSLT and FOP.
ally
Posts: 2

value-of without content of child elements

Sun Jun 26, 2005 2:03 pm

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
george
Site Admin
Posts: 2100

Mon Jun 27, 2005 9:47 am

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]
<xsl:for-each select="text()">
<xsl:value-of select="."/>
</xsl:for-each>
</code]

Best Regards,
George

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest