
c14n2.pl -- C14n2 canonical XML documentsC14n2 specifies a canonical XML document. This library writes such a document from an XML DOM as returned by the XML (or SGML) parser. The process takes two steps:
xml_write_canonical(+Stream, +DOM, +Options) is detxmlns and the option keep_prefix(true). Options:
xml_canonical_dom(+DOM, -CDOM, +Context)[private]ctx(Mode, InScope, Rendered), where InScope is a
dict mapping prefixes to namespace URIs that are in scope and
Rendered is a dict mapping the prefixes that are declared by the
output ancestors. The default namespace uses the prefix ''.
For inclusive canonicalization, an element declares each in-scope namespace that is not declared with the same URI by its output ancestors. For exclusive canonicalization, it only does so for the namespaces that are visibly utilized by the element name and its attributes. Namespace declarations are ordered by prefix, the default namespace first. Attributes are ordered by namespace URI and local name, attributes without a namespace first.