Re: [xslt] equality expression bug?



On Fri, Jul 08, 2005 at 11:13:48PM -0700, Bob Stayton wrote:
> Does anyone else think the middle test produces the wrong result?  My
> understanding is that in equality expressions, if one operand is a number
> then the other is converted to a number.  Converting a node means first
> converting it to a string and then converting that string to a number.  So
> that node conversion should yield NaN, which should not be equal to zero. Am
> I missing something, or should I file a bug report?

 What I read from the spec is:

  http://www.w3.org/TR/xpath#booleans

 "If one object to be compared is a node-set and the other is a number,
  then the comparison will be true if and only if there is a node in
  the node-set such that the result of performing the comparison on the
  number to be compared and on the result of converting the string-value
  of that node to a number using the number function is true."

the node set has only one text node. The string value of that node is
"A" so that should lead to NaN, right. So it seems it's a bug and bugzilla
might be in order,

  thanks,

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]