Next in thread → Next in month →

RE: [xml-dev] XPath 2.0 data-model - dm:string-value of a node

From
Michael Kay <>
To
'Chris Burdess' <>
Date
2008-02-29T16:46:27
ID
<01c701c87af2$a1261140$6401a8c0@turtle>
Thread
RE: [xml-dev] XPath 2.0 data-model - dm:string-value of a node
> If you change the core semantics of a function, the function 
> should really be renamed. If it's not renamed, you need to 
> include clear warnings about incompatibility between 
> versions. I think that XPath 2.0 did a very good job in this regard.
> 
> However, in the incompatibility notes for XPath 2.0 it 
> doesn't say anything about a change to the semantics of 
> text(). Also, I can't find anything in the XPath 1.0 
> specification that says that text() should only match the 
> first text node. In fact, it says:
> 
>   "The node test text() is true for any text node. For example,
>   child::text() will select the text node children of the 
> context node."
> 
> This is true of XPath 2.0 as well. So does this horrible 
> backwards incompatibility even actually exist?

As I explained earlier in this thread, the result of the path expression
hasn't changed. It's the <xsl:value-of> instruction that has changed. This
is clearly documented in list item 1 of

http://www.w3.org/TR/xslt20/#backwards-compatibility-behavior

Note that the incompatibility only arises if you change the version
attribute of xsl:stylesheet to "2.0" - 1.0 stylesheets if unchanged behave
as they did before.

Michael Kay
http://www.saxonica.com/
Next in thread → Next in month →