XPath queries match nodes in the default namespace
When querying an XML document that explicitly defines the default XML namespace the XPath evaluator now correctly matches all nodes within that namespace if no namespace prefix is given in the query. Previously this would always return an empty set.
This commit is contained in:
1 parent
f175414917
commit
5adeae18d0
2 files changed
+79
-46
No files matched your search
@@ -1657,6 +1657,11 @@ module Oga
|
||||
ns_matches = true
|
||||
end
|
||||
|
||||
if !ns and !ns_matches
|
||||
ns_matches = xml_node.respond_to?(:default_namespace?) &&
|
||||
xml_node.default_namespace?
|
||||
end
|
||||
|
||||
return name_matches && ns_matches
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user