[not loaded]All predicatesShow sourcec14n2.pl -- C14n2 canonical XML documents

C14n2 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:

Source xml_write_canonical(+Stream, +DOM, +Options) is det
Write an XML DOM using the canonical conventions as defined by C14n2. Namespace declarations in the canonical document depend on the original namespace declarations. For this reason the input document must be parsed (see load_structure/3) using the dialect xmlns and the option keep_prefix(true). Options:
method(+URI)
One of `http://www.w3.org/TR/2001/REC-xml-c14n-20010315` (inclusive, default), `http://www.w3.org/2006/12/xml-c14n11` (handled as inclusive) or `http://www.w3.org/2001/10/xml-exc-c14n#` (exclusive).
Source xml_canonical_dom(+DOM, -CDOM, +Context)[private]
Context is a term 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.