Micro Document Object Model: a partial DOM implementation with SUX.

This is an implementation of what we consider to be the useful subset of the DOM. The chief advantage of this library is that, not being burdened with standards compliance, it can remain very stable between versions. We can also implement utility 'pythonic' ways to access and mutate the XML tree.

Since this has not subjected to a serious trial by fire, it is not recommended to use this outside of Twisted applications. However, it seems to work just fine for the documentation generator, which parses a fairly representative sample of XML.

Microdom mainly focuses on working with HTML and XHTML.

Function getElementsByTagName Return a list of all child elements of iNode with a name matching name.
Function getElementsByTagNameNoCase Undocumented
Variable HTML_ESCAPE_CHARS Undocumented
Variable REV_HTML_ESCAPE_CHARS Undocumented
Variable XML_ESCAPE_CHARS Undocumented
Variable REV_XML_ESCAPE_CHARS Undocumented
Function unescape Perform the exact opposite of 'escape'.
Function escape Escape a few XML special chars with XML entities.
Class MismatchedTags Undocumented
Class Node No class docstring; 0/1 class variables, 0/2 instance variables, 5/14 methods documented
Class Document No class docstring; 0/2 class variables, 1/11 methods documented
Class EntityReference Undocumented
Class CharacterData Undocumented
Class Comment A comment node.
Class Text No class docstring; 0/1 instance variables, 1/5 methods documented
Class CDATASection Undocumented
Variable genprefix Undocumented
Class Element No class docstring; 0/8 instance variables, 2/17 methods documented
Class MicroDOMParser Undocumented
Function parse Parse HTML or XML readable.
Function parseString Undocumented
Function parseXML Parse an XML readable object.
Function parseXMLString Parse an XML readable object.
Class lmx Easy creation of XML.
Function _streamWriteWrapper Undocumented
Function _genprefix Undocumented
Class _Attr Support class for getAttributeNode.
Function _unescapeDict Undocumented
Function _reverseDict Undocumented
def getElementsByTagName(iNode, name): (source)

Return a list of all child elements of iNode with a name matching name.

Note that this implementation does not conform to the DOM Level 1 Core specification because it may return iNode.

ParametersiNodeAn element at which to begin searching. If iNode has a name matching name, it will be included in the result.
nameA str giving the name of the elements to return.
ReturnsA list of direct or indirect child elements of iNode with the name name. This may include iNode.
def getElementsByTagNameNoCase(iNode, name): (source)
def _streamWriteWrapper(stream): (source)
(type: Tuple)
def unescape(text, chars=REV_HTML_ESCAPE_CHARS): (source)

Perform the exact opposite of 'escape'.

def escape(text, chars=HTML_ESCAPE_CHARS): (source)

Escape a few XML special chars with XML entities.

def _genprefix(): (source)
genprefix =
def _unescapeDict(d): (source)
def _reverseDict(d): (source)
def parse(readable, *args, **kwargs): (source)

Parse HTML or XML readable.

def parseString(st, *args, **kw): (source)
def parseXML(readable): (source)

Parse an XML readable object.

def parseXMLString(st): (source)

Parse an XML readable object.

API Documentation for Twisted, generated by pydoctor at 2020-03-20 23:54:06.