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