[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: union and difference

Subject: Re: union and difference
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Sun, 13 May 2001 15:39:50 GMT
edt gmt 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.