module documentation
(source)

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.

Class ​CDATASection Undocumented
Class ​Character​Data Undocumented
Class ​Comment A comment node.
Class ​Document No class docstring; 0/1 property, 0/1 class variable, 1/10 method documented
Class ​Element No class docstring; 0/10 instance variable, 2/17 methods documented
Class ​Entity​Reference Undocumented
Class lmx Easy creation of XML.
Class ​Micro​DOMParser Undocumented
Class ​Mismatched​Tags Undocumented
Class ​Node No class docstring; 0/2 instance variable, 0/1 class variable, 5/14 methods documented
Class ​Text No class docstring; 0/1 instance variable, 1/5 method documented
Function escape Escape a few XML special chars with XML entities.
Function get​Elements​By​Tag​Name Return a list of all child elements of iNode with a name matching name.
Function get​Elements​By​Tag​Name​No​Case Undocumented
Function parse Parse HTML or XML readable.
Function parse​String Undocumented
Function parse​XML Parse an XML readable object.
Function parse​XMLString Parse an XML readable object.
Function unescape Perform the exact opposite of 'escape'.
Constant HTML​_ESCAPE​_CHARS Undocumented
Constant REV​_HTML​_ESCAPE​_CHARS Undocumented
Constant REV​_XML​_ESCAPE​_CHARS Undocumented
Constant XML​_ESCAPE​_CHARS Undocumented
Variable genprefix Undocumented
Class _​Attr Support class for getAttributeNode.
Function _genprefix Undocumented
Function _reverse​Dict Undocumented
Function _stream​Write​Wrapper Undocumented
Function _unescape​Dict Undocumented
def escape(text, chars=HTML_ESCAPE_CHARS): (source)
Escape a few XML special chars with XML entities.
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.

Parameters
i​NodeAn 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.
Returns
A list of direct or indirect child elements of iNode with the name name. This may include iNode.
def getElementsByTagNameNoCase(iNode, name): (source)

Undocumented

def parse(readable, *args, **kwargs): (source)
Parse HTML or XML readable.
def parseString(st, *args, **kw): (source)

Undocumented

def parseXML(readable): (source)
Parse an XML readable object.
def parseXMLString(st): (source)
Parse an XML readable object.
def unescape(text, chars=REV_HTML_ESCAPE_CHARS): (source)
Perform the exact opposite of 'escape'.
HTML_ESCAPE_CHARS: tuple = (source)

Undocumented

Value
(('&', '&amp;'), ('<', '&lt;'), ('>', '&gt;'), ('"', '&quot;'))
REV_HTML_ESCAPE_CHARS = (source)

Undocumented

Value
list(HTML_ESCAPE_CHARS)
REV_XML_ESCAPE_CHARS = (source)

Undocumented

Value
list(XML_ESCAPE_CHARS)
XML_ESCAPE_CHARS = (source)

Undocumented

Value
HTML_ESCAPE_CHARS+(('\'', '&apos;'))
genprefix = (source)

Undocumented

def _genprefix(): (source)

Undocumented

def _reverseDict(d): (source)

Undocumented

def _streamWriteWrapper(stream): (source)

Undocumented

def _unescapeDict(d): (source)

Undocumented