Class: Nokolexbor::XPathContext

Inherits:
Object
  • Object
show all
Defined in:
lib/nokolexbor/xpath_context.rb

Instance Method Summary collapse

Instance Method Details

#register_namespaces(namespaces) ⇒ Object

Register namespaces in namespaces



7
8
9
10
11
12
# File 'lib/nokolexbor/xpath_context.rb', line 7

def register_namespaces(namespaces)
  namespaces.each do |k, v|
    k = k.to_s.gsub(/.*:/, "") # strip off 'xmlns:' or 'xml:'
    register_ns(k, v)
  end
end