Re: [xml] XPath, NODE_TEST_ALL and namespace

On Mon, Jun 10, 2013 at 10:43:19AM +0200, François Delyon wrote:

The NODE_TEST_ALL  test is not correct.
For an xpath expression "p:*", libxml returns the correct list of
the elements in the namespace associated to the prefix "p".

That is not the case for the expression "@p:*".
libxml does not test the namespace of the attributes.

See the function xmlXpathNodeCollectAndTest (xpath.c ) line 12419 in
2.9.1 :
      case NODE_TEST_ALL:...
I think that the AXIS_ATTRIBUTE must be handled like the

  I actually looked at that last week an you may be correct, but
I need to double check. The usual weirdness is that attributes without
an explicit namespace do not get assigned to a default namespace if it
exists. That's one of the things which leads to such surprize, but the
code might be wrong, I just didn't fully checked yet,


Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit | virtualization library

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