% This LaTeX document was generated using the LaTeX backend of PlDoc, % The SWI-Prolog documentation system \subsection{library(c14n2): C14n2 canonical XML documents} \label{sec:c14n2} C14n2 specifies a \textit{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: \begin{shortlist} \item Normalise the DOM \item Call \predref{xml_write}{3} with appropriate flags \end{shortlist} \vspace{0.7cm} \begin{description} \predicate[det]{xml_write_canonical}{3}{+Stream, +DOM, +Options} Write an XML \arg{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 \predref{load_structure}{3}) using the dialect \const{xmlns} and the option \verb$keep_prefix(true)$. \end{description}