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(/..)

Thank you Michael, your "0">"" is the minimal "isXPath2" expression:

$ java -jar ~/Desktop/saxon6-5-5/saxon.jar dummy.xml xpv.xsl
true
true
false
$
$ java -jar ~/Downloads/saxon9608/saxon9he.jar -xsl:xpv.xsl -s:dummy.xml
true
false
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:value-of select='"0">""'/><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/
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

Inactive hide details for Michael Kay ---19.12.2015 20:00:05---> On 19 Dec 2015, at 14:12, Hermann Stamm-Wilbrandt <STAMMW@de.iMichael Kay ---19.12.2015 20:00:05---> On 19 Dec 2015, at 14:12, Hermann Stamm-Wilbrandt <STAMMW@de.ibm.com> wrote: >

From: Michael Kay <mike@saxonica.com>
To: Hermann Stamm-Wilbrandt/Germany/IBM@IBMDE
Cc: xml-dev@lists.xml.org
Date: 19.12.2015 20:00
Subject: Re: [xml-dev] isXPath1 / isXPath2 -- not(/..)







This difference is explained in the "incompatibilities" appendix of the XPath 2.0 specification (section I.2 clause 5):
/.. is of course an empty node-set in XPath 1.0, or simply an empty sequence in XPath 2.0.
No, it is true for both. /.. is an empty node-set; converting an empty node-set to boolean gives false; not(false) gives true.

Here's another expression that gives different results under XPath 1.0 and XPath 2.0:

"2"<"10"

or even shorter:

"0">""

Michael Kay
Saxonica




[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