lib/rdf/xsd/extensions.rb
##
# Canonicalize the Element. Return a new instance of this node
# which is canonicalized and marked as such.
#
# Apply namespaces either passed as an option, or that are in scope.
#
# @param [Hash{Symbol => Object}] options
#   From {Nokogiri::XML::Node#c14nxl}
Canonicalize the Element. Return a new instance of this node
which is canonicalized and marked as such.

Apply namespaces either passed as an option, or that are in scope.
Canonicalize the Element . Return a new instance of this node which is canonicalized and marked as such . Apply namespaces either passed as an option or that are in scope .
def c14nxl(options = {})
        options[:namespaces] ||= self.namespace_scopes.compact.inject({}) do |memo, ns|
          memo[ns.prefix] = ns.href.to_s
          memo
        end
        element = self.clone
        options[:namespaces].each do |prefix, href|
          if prefix.to_s.empty?
            element.default_namespace = href unless element.namespace
          else
            element.add_namespace(prefix.to_s, href) unless element.namespaces[prefix.to_s]
          end
        end
        element["xml:lang"] = options[:language].to_s if
          options[:language] &&
          element.attribute_with_ns("lang", "http://www.w3.org/XML/1998/namespace").to_s.empty? &&
          element.attribute("lang").to_s.empty?
        element
      end
def c14nxl ( options = { } ) options [ :namespaces ] ||= self . namespace_scopes . compact . inject ( { } ) do | memo , ns | memo [ ns . prefix ] = ns . href . to_s memo end element = self . clone options [ :namespaces ] . each do | prefix , href | if prefix . to_s . empty? element . default_namespace = href unless element . namespace else element . add_namespace ( prefix . to_s , href ) unless element . namespaces [ prefix . to_s ] end end element [ "xml:lang" ] = options [ :language ] . to_s if options [ :language ] && element . attribute_with_ns ( "lang" , "http://www.w3.org/XML/1998/namespace" ) . to_s . empty? && element . attribute ( "lang" ) . to_s . empty? element end
Canonicalize the Element.
Canonicalize the Element .
# Add in-scope namespace definitions # Add language
options
options From {Nokogiri::XML::Node#c14nxl}
options From { Nokogiri :: XML :: Node#c14nxl }