[Home] [By Thread] [By Date] [Recent Entries]

  • From: David Carlisle <d.p.carlisle@g...>
  • To: Hermann Stamm-Wilbrandt <STAMMW@d...>
  • Date: Sat, 19 Dec 2015 17:33:35 +0000



On 19 December 2015 at 17:22, Hermann Stamm-Wilbrandt <STAMMW@d...> 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]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member