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]
isXPath1 / isXPath2 -- not(/..)

More than a year ago Jonathan Robie tweeted on this nice XPath expression:
false()=/..

The expression is true for XPath 1.0 and false for XPath 2.0.
Therefore the expression can be named "isXPath1".

I cannot find his tweet anymore, nor my reply tweet with this minimal
equivalent "isXPath1" expression:
(4=5)=/..

I was not able to reduce the expression until today.
Still above expression is minimal for "isXPath1", but a character can be
reduced for "isXPath2":
not(/..)


This expression is true for XPath 2.0 and false for XPath 1.0.

$ java net.sf.saxon.Query -qs:"(4=5)=/.." \!omit-xml-declaration=yes ; echo
false
$ java net.sf.saxon.Query -qs:"not(/..)" \!omit-xml-declaration=yes ; echo
true
$ java net.sf.saxon.Query 2>&1 | head -2
No query file name
Saxon-HE 9.6.0.8J from Saxonica
$


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



[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