xsl-list
[Top] [All Lists]

[xsl] XPAth 2.0/General Comparisons

2007-05-04 08:36:12
Hi,

I am trying to better grasp the concept of General Comparisons in XPath 2.0.
The rules listed in 3.5.2 of the recommendation
(http://www.w3.org/TR/xpath20/#id-general-comparisons) would suggest that
the following expression should work;


true() = 10
Should work right? step 1 of section 3.5.2:
"If either operand is a single atomic value that is an instance of
xs:boolean, then the other operand is converted to xs:boolean by taking its
effective boolean value."

The effective boolean value of 10 is true (I get an error cannot compare
xs:Boolean to xs:integer)

10 < '10.2' 
Should work (?) due to step 3 of section 3.5.2:
"If the comparison operator is <, <=, >, or >=, then each item in both of
the operand sequences is converted to the type xs:double by applying the
fn:number function. (Note that fn:number returns the value NaN if its
operand cannot be converted to a number.)"

And number('10.2') is correct, however I get an error Cannot compare
xs:integer to xs:string


I am testing with oXygen 7.2 and have it set to XPath 2.0

What am I missing?

Tx.,

Raphael



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>