1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

Fix XPath expressions of the form '@ns:*'

Use namespace for match-all queries on the attribute axis.
This commit is contained in:
Nick Wellnhofer
2013-08-05 01:26:25 +02:00
parent b4bcba23f6
commit e8de99f90c

View File

@@ -12424,8 +12424,15 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
case NODE_TEST_ALL: case NODE_TEST_ALL:
if (axis == AXIS_ATTRIBUTE) { if (axis == AXIS_ATTRIBUTE) {
if (cur->type == XML_ATTRIBUTE_NODE) if (cur->type == XML_ATTRIBUTE_NODE)
{
if (prefix == NULL)
{ {
XP_TEST_HIT XP_TEST_HIT
} else if ((cur->ns != NULL) &&
(xmlStrEqual(URI, cur->ns->href)))
{
XP_TEST_HIT
}
} }
} else if (axis == AXIS_NAMESPACE) { } else if (axis == AXIS_NAMESPACE) {
if (cur->type == XML_NAMESPACE_DECL) if (cur->type == XML_NAMESPACE_DECL)