Sha256: f9cfdebec7e6fe64c5d27cf3ca5c9684ee632f0a2f795753ecb5885d6e05002f

Contents?: true

Size: 461 Bytes

Versions: 11

Compression:

Stored size: 461 Bytes

Contents

require 'nokogiri'
class Nokogiri::XML::Node
  # URI of namespace + node_name
  def uri
    ns = self.namespace ? self.namespace.href : RDF::XML.to_s
    RDF::URI.intern(ns + self.node_name)
  end

  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
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
the-experimenters-rdf-rdfxml-0.3.3 lib/rdf/rdfxml/patches/nokogiri_hacks.rb
rdf-rdfxml-0.3.3 lib/rdf/rdfxml/patches/nokogiri_hacks.rb
rdf-rdfa-0.3.1.2 lib/rdf/rdfa/patches/nokogiri_hacks.rb
rdf-rdfxml-0.3.2.1 lib/rdf/rdfxml/patches/nokogiri_hacks.rb
rdf-rdfxml-0.3.2 lib/rdf/rdfxml/patches/nokogiri_hacks.rb
rdf-rdfxml-0.3.1 lib/rdf/rdfxml/patches/nokogiri_hacks.rb
rdf-rdfa-0.3.1.1 lib/rdf/rdfa/patches/nokogiri_hacks.rb
rdf-rdfa-0.3.0 lib/rdf/rdfa/patches/nokogiri_hacks.rb
rdf-rdfxml-0.3.0 lib/rdf/rdfxml/patches/nokogiri_hacks.rb
rdf-rdfa-0.2.2 lib/rdf/rdfa/patches/nokogiri_hacks.rb
rdf-rdfxml-0.2.3 lib/rdf/rdfxml/patches/nokogiri_hacks.rb