Class: VCDOM::XPath::XPathNSResolver
- Inherits:
-
Object
- Object
- VCDOM::XPath::XPathNSResolver
- Defined in:
- lib/vcdom/xpath/xpath_ns_resolver.rb
Overview
A XPathNSResolver object permit prefix strings in the expression to be properly bound to namespaceURI strings. XPathEvaluator can construct an implementation of XPathNSResolver from a node, or the interface may be implemented by any application.
Way to create a XPathNSResolver object
If you want a XPathNSResolver object, please use XPathEvaluatorMod#create_expression. The class Document includes the module XPathEvaluatorMod when you required “vcdom/xpath”, so you can use this method as the following:
require "vcdom"
require "vcdom/xpath"
# doc is a Document object
resolver = doc.create_ns_resolver( node )
Instance Method Summary collapse
-
#initialize(ns_resolver) ⇒ XPathNSResolver
constructor
:nodoc:.
-
#lookup_namespace_uri(prefix) ⇒ Object
Look up the namespace URI associated to the given namespace prefix.
Constructor Details
#initialize(ns_resolver) ⇒ XPathNSResolver
:nodoc:
22 23 24 |
# File 'lib/vcdom/xpath/xpath_ns_resolver.rb', line 22 def initialize( ns_resolver ) # :nodoc: @ns_resolver = ns_resolver end |
Instance Method Details
#lookup_namespace_uri(prefix) ⇒ Object
Look up the namespace URI associated to the given namespace prefix. The XPath evaluator must never call this with a null or empty argument, because the result of doing this is undefined.
29 30 31 32 |
# File 'lib/vcdom/xpath/xpath_ns_resolver.rb', line 29 def lookup_namespace_uri( prefix ) # TODO nil end |