Class: Nokogiri::XML::Node
- Inherits:
-
Object
- Object
- Nokogiri::XML::Node
- Defined in:
- lib/rdf_context/nokogiri_hacks.rb
Instance Method Summary collapse
- #display_path ⇒ Object
-
#uri ⇒ Object
URI of namespace + node_name.
Instance Method Details
#display_path ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/rdf_context/nokogiri_hacks.rb', line 8 def display_path @display_path ||= case self when Nokogiri::XML::Document then "" when Nokogiri::XML::Element then parent ? "#{parent.display_path}/#{name}" : name when Nokogiri::XML::Attr then "#{parent.display_path}@#{name}" end end |
#uri ⇒ Object
URI of namespace + node_name
4 5 6 7 |
# File 'lib/rdf_context/nokogiri_hacks.rb', line 4 def uri ns = self.namespace ? self.namespace.href : RdfContext::XML_NS.uri.to_s RdfContext::URIRef.new(ns + self.node_name, :normalize => false) end |