Closed matthiasmalsy closed 4 years ago
It seems that the behavior is correct. In an untyped schema, the default comparison method is alphabetical (XPATH2.0)
Some other parsers convert the operand to decimal if the other operand is a constant number/expression
e.g. "//myvalue20 > 8" ===> number(//myvalue20) > integer(8)
I can not find any hint in the XPATH 2.0 specification how to correctly treat this case.
But as already mentioned. This parser always uses alphabetical order. And it seems to be defined in the spec.
"//myvalue20 > //myvalue8" ===> string(20) > string(8) ====> false
"//myvalue20 > 8" ===> string(20) > integer(8) ====> type mismatch
Number comparison only works, if an explicit number()-conversion is done.
In the following example, the elements are number types. And I am sure, it worked for me in a former version. (Maybe an old version of XPATH2 or the XPATH-1version of dotnet).
Microsoft XPATH