XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] isXPath1 / isXPath2 -- not(/..)



On 19 December 2015 at 17:22, Hermann Stamm-Wilbrandt <STAMMW@de.ibm.com> wrote:
You are right on "/..", but "(4=5)=/.."  does work as "isXPath1".
DataPower XSLT 1.0 processor agrees with Saxon 6.5.5 XSLT 1.0 processor.
So it seems my understanding that   not(/...)   is equivalent to   (4=5)=/..
is wrong ...
What is the difference?

in xpath 1 not(/..) will coerce /.. from a node set to a boolean by the rule that empty node sets
are false so  it's not(false()) which is true.

false()=/.. or (4=5)=/..
is equality of a boolean against a node set so this will use the existential form and be true just if
some node in the node set has string value  equal to the string value of false(). As the node set is empty
then this is necessarily false (although I note saxon 6 reports true)

David


 

Or maybe both, Saxon 6.5.5 and DataPower processor have a bug?

$ java -jar ~/Desktop/saxon9-0-0-8/saxon9.jar dummy.xml xpv.xsl; echo
true
false

$ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml xpv.xsl; echo
true
true

$ xj xpv.xsl dummy.xml
true
true
$
$ cat xpv.xsl
<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
  <xsl:output omit-xml-declaration="yes" />
   
  <xsl:template match="/">
    <xsl:value-of select="not(/..)"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="(4=5)=/.."/><xsl:text>&#10;</xsl:text>
  </xsl:template>
 
</xsl:stylesheet>
$


Mit besten Gruessen / Best wishes,


Hermann Stamm-Wilbrandt
Compiler Level 3 support & Fixpack team lead
IBM DataPower Gateways (⬚ᵈᵃᵗᵃ / ⣏⠆⡮⡆⢹⠁⡮⡆⡯⠂⢎⠆⡧⡇⣟⡃⡿⡃)
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
https://twitter.com/HermannSW/ https://stamm-wilbrandt.de/GraphvizFiddle/
----------------------------------------------------------------------




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS