PyDocs

Nav

Structured Markup Processing Tools

canonicalize

xml.etree.ElementTree

function · Added in 3.8 (source)
  • canonicalize(xml_data=None, *, out=None, from_file=None, **options)
Convert XML to its C14N 2.0 serialised form.

If *out* is provided, it must be a file or file-like object that
receives the serialised canonical XML output (text, not bytes) through
its ``.write()`` method.  To write to a file, open it in text mode with
encoding "utf-8".  If *out* is not provided, this function returns the
output as text string.

Either *xml_data* (an XML string) or *from_file* (a file path or
file-like object) must be provided as input.

The configuration options are the same as for the ``C14NWriterTarget``.
0 Examples
No examples for xml.etree.ElementTree/canonicalize.
See Also
No see-alsos for xml.etree.ElementTree/canonicalize
0 Notes
No notes for canonicalize