[Home] [By Thread] [By Date] [Recent Entries]
On 12/6/06, CMS <cms@xxxxxxxxxxxxx> wrote:
Hi,
When you do value-of on <text> you get the text nodes of the element and all its children concatenated together, so you would get the text node child of <emph> - which isnt what you want. When you do value-of select="text()" on <text> to only get the text node children you get a sequence of two items - the two text nodes. In 1.0 when you have a list of more than one item the first is used and the rest discarded (to allow functions that expect a single item to not fail if a list is supplied - XSLT 1.0 was designed to always produce some output). What all this means is that in 1.0 you can do either: <xsl:for-each select="text()"> <xsl:value-of select="."/> </xsl:for-each> or <xsl:apply-templates select="text()"/> Either technique will process each text node in turn. In 2.0 all the items in the sequence get concatenated together using a separator (if one's not supplied the default of a single space is used), so a simple value-of select="text()" does the job. cheers andrew
|

Cart



