|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: union and difference
Hi Dan,
>Finally, I am not sure I agree with another reply with regard
>to merging of text nodes. I beleive the following definition of
>$set1 will in fact have four distinct nodes:
>
> <xsl:variable name="set1" select="set1/text()"/>
> <xsl:value-of select="count($set1)"/>
>
>Adjacent text nodes get merged on occassion but perhaps
>some could clarify precisely when this happens as I am not
>100% certain.
>
Sorry.
You are right of course - I just checked the spec. Adjacent text
nodes get merged in result tree fragments, not node sets. For
example,
<xsl:variable name="set1">
<xsl:for-each select="set1/text()">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="count($set1/text())"/>
might seem a clumsier way of doing the same thing, but in fact gets
you one node not four. (Only works post XSLT 1.0 too - it converts an
RTF to a node set).
Regards,
Trevor Nash
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








