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
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 Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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