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

RE: Weird XPath evaluation differences between Saxon a

Subject: RE: Weird XPath evaluation differences between Saxon and Xalan
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 9 Jun 2005 13:48:58 +0100
xpath evaluation
In XSLT 1.0, xsl:value-of when applied to a set of nodes gives you the value
of the first node, and ignores the others.

In XSLT 2.0, it gives you the values of all the nodes - by default space
separated.

If you run a 2.0 processor but specify version="1.0" you get
backwards-compatible behavior, i.e. the 2.0 processor gives you the same
result as a 1.0 processor.

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

> -----Original Message-----
> From: Simon OUALID [mailto:symon@xxxxxxxxxxx]
> Sent: 08 June 2005 22:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Weird XPath evaluation differences between
> Saxon and Xalan
>
> Hi,
>
> I have a question regarding a XPath evaluation difference
> between Saxon
> and Xalan (using the latest release of both tools), with the same XML
> datas and the XPath query !
>
> Considering this XML tree :
>
> <GROUP>
>   <SOMETHING>
>     <NAME>AA</NAME>
>   </SOMETHING>
>   <SOMETHING>
>     <NAME>BB</NAME>
>   </SOMETHING>
>   <SOMETHING>
>     <NAME>CC</NAME>
>   </SOMETHING>
> </GROUP>
>
> and the following XPath query :
>
> <xsl:value-of select="./SOMETHING/NAME"/>
> in the context of a <xsl:apply-templates select="/GROUP"/>
>
> Xalan will output "AA" but Saxon output "AABBCC" !
>
> Stranger is than changing the version of the stylesheet modify the
> comportment of Saxon : using a 1.0 stylesheet, Saxon will output "AA"
> (as Xalan do !), but using ` 2.0 stylesheet, Saxon output "AABBCC".
>
> What's the standard says about that ? I'd like to follow W3C
> prescription !
>
> Should I change my XPath query with GROUP like :
>
> <xsl:value-of select="./SOMETHING//NAME"/>
>
> or maybe :
>
> <xsl:value-of select="./SOMETHING[*]/NAME"/>
>
> Thanks forward for any information on this subject. For
> information, the
> result I expect is "AABBCC".
>
> Symon

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.