xsl-list
[Top] [All Lists]

RE: Get text of one element

2005-08-27 01:50:20
When I use <xsl:value-of select="."/> to get the text of one 
element. It
return all text of current node and its descendant nodes. Is 
there any way
to retrieve only the text of current node?

In XSLT 2.0, <xsl:value-of select="text()" separator=""/> returns the
concatenation of all the child text nodes.

In XSLT 1.0, if there might be more than one text node, use

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

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>