Re: [xml] XPath question w/ libxml2



On Thu, Apr 15, 2004 at 05:07:40PM -0600, Mark_Vakoc peoplesoft com wrote:

So I agree it sounds like this should select no node.
The difference though is that at least on my platform this works as
expected:
  
Yep, not on my platform (win32):
C:\gsstools\bin>xmllint --shell c:\t.xml
/ > ls
---        9 root
/ > xpath root[1]
Object is a Node Set :
Set contains 1 nodes:
1  ELEMENT root
/ > xpath root[number('NaN')]
Object is a Node Set :
Set contains 1 nodes:
1  ELEMENT root
/ >

I'm afraid you might be seeing some weird floating point troubles.
Can you try to see if the basic tests from test/XPath/expr/floats
work correctly first ? Then it might be number('NaN') failing or
the index tests.

Ok, will look into those tests and try and patch it up now that I know
what the correct behavior should be.

  The fist thing would be to check the NaN initialization in xpath.c
and taht number('NaN') actually produce the value.
  Gut feeling is that there a int number compared to a NaN double 
in the XPath Predicate evaluation which might set an error flag but
not generate a test error. Hopefully a short session with a debugger
should be able to pinpoint the problem,

  good hunting !

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]