Description: This is a Python library that generates idiomatic XML code through context managers
xmlwitch has two classes: Builder and Element.
Builder takes three parameters:
encoding, which is required and defaulted to UTF-8;
version, whose optional presence adds a <?xml?> processing instruction at the top of the document;
indent, which determines the white-space string used to indent the document tree (defaulted to two spaces).
xmlwitch currently only generates human-readable XML documents, with linebreaks and indentation.
Namespaced elements can be created by using square brackets.
It is a minimalist implementation, written in less than 100 lines of code.
Related: indentationnamespaced, elementbuilder, defaulted, Lines, at the, created, can be, by using, Builder, bracketsit, xml documents, xml code, square bracketsit, spacesxmlwitch, classes builder, utf version, utf version optional, determines, linebreaks, option
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB