Fix XPath queries using default XML namespace
This fixes https://gitlab.com/yorickpeterse/oga/issues/195
This commit is contained in:
1 parent
d492a775bf
commit
95da93949b
2 files changed
+29
-2
No files matched your search
@@ -1391,14 +1391,19 @@ module Oga
|
||||
if ns and ns != STAR
|
||||
if @namespaces
|
||||
ns_uri = @namespaces[ns]
|
||||
ns_match =
|
||||
ns_match =
|
||||
if ns_uri
|
||||
input.namespace.and(input.namespace.uri.eq(string(ns_uri)))
|
||||
else
|
||||
self.false
|
||||
end
|
||||
else
|
||||
ns_match = input.namespace_name.eq(string(ns))
|
||||
ns_match =
|
||||
if ns == XML::Element::XMLNS_PREFIX
|
||||
input
|
||||
else
|
||||
input.namespace_name.eq(string(ns))
|
||||
end
|
||||
end
|
||||
|
||||
condition = condition ? condition.and(ns_match) : ns_match
|
||||
|
||||
Reference in new issue
Block a user