Re: [xml] XPath, NODE_TEST_ALL and namespace
- From: Daniel Veillard <veillard redhat com>
- To: François Delyon <f delyon satimage fr>
- Cc: libxml <xml gnome org>
- Subject: Re: [xml] XPath, NODE_TEST_ALL and namespace
- Date: Tue, 18 Jun 2013 15:45:06 +0200
On Mon, Jun 10, 2013 at 10:43:19AM +0200, François Delyon wrote:
Hi,
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
XML_ELEMENT_NODE.
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
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard redhat com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]