class Nokogiri::XML::Node

XML Exclusive Canonicalization (c14n) for Nokogiri.

Classes mixin this module to implement canonicalization methods.

This implementation acts in two parts, first to canonicalize the Node or NoteSet in the context of its containing document, and second to serialize to a lexical representation.

@see # @see www.w3.org/TR/xml-exc-c14n/

Public Instance Methods

c14nxl(options = {}) click to toggle source

Canonicalize the Node. Return a new instance of this node which is canonicalized and marked as such

@param [Hash{Symbol => Object}] options @option options [Hash{String => String}] :namespaces

Namespaces to apply to node.

@option options [#to_s] :language

Language to set on node, unless an xml:lang is already set.
# File lib/rdf/xsd/extensions.rb, line 29
def c14nxl(options = {})
  @c14nxl = true
  self
end
to_s()
Also aliased as: to_s_without_c14nxl
Alias for: to_s_with_c14nxl
to_s_with_c14nxl() click to toggle source

Serialize a canonicalized Node or NodeSet to XML

Override standard to_s implementation to output in c14n representation if the Node or NodeSet is marked as having been canonicalized

# File lib/rdf/xsd/extensions.rb, line 39
def to_s_with_c14nxl
  if instance_variable_defined?(:@c14nxl)
    serialize(:save_with => ::Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS)
  else
    to_s_without_c14nxl
  end
end
Also aliased as: to_s
to_s_without_c14nxl()
Alias for: to_s