PyDocs

Nav

Structured Markup Processing Tools

C14NWriterTarget

xml.etree.ElementTree

class · Added in 3.8 (source)
  • C14NWriterTarget(write, *, with_comments=False, strip_text=False, rewrite_prefixes=False, qname_aware_tags=None, qname_aware_attrs=None, exclude_attrs=None, exclude_tags=None)
Canonicalization writer target for the XMLParser.

Serialises parse events to XML C14N 2.0.

The *write* function is used for writing out the resulting data stream
as text (not bytes).  To write to a file, open it in text mode with
encoding "utf-8" and pass its ``.write`` method.

Configuration options:

- *with_comments*: set to true to include comments
- *strip_text*: set to true to strip whitespace before and after text
                content
- *rewrite_prefixes*: set to true to replace namespace prefixes by
                      "n{number}"
- *qname_aware_tags*: a set of qname aware tag names in which prefixes
                      should be replaced in text content
- *qname_aware_attrs*: a set of qname aware attribute names in which
                       prefixes should be replaced in text content
- *exclude_attrs*: a set of attribute names that should not be
                   serialised
- *exclude_tags*: a set of tag names that should not be serialised
0 Examples
No examples for xml.etree.ElementTree/C14NWriterTarget.
See Also
No see-alsos for xml.etree.ElementTree/C14NWriterTarget
0 Notes
No notes for C14NWriterTarget