Package twisted :: Package web :: Module microdom |
[show private | hide private]
[frames | no frames]

## Module twisted.web.microdom

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.

Classes
`CDATASection` |
`CharacterData` |
`Comment` | A comment node.
`Document` |
`Element` |
`EntityReference` |
`lmx` | Easy creation of XML.
`MicroDOMParser` |
`Node` |
`Text` |
`_Attr` | Support class for getAttributeNode.

Exceptions
`MismatchedTags` |

Function Summary
| ``escape`(text)` Escape a few HTML special chars with HTML entities.
| `getElementsByTagName(iNode, name)`
| `getElementsByTagNameNoCase(iNode, name)`
| ``parse`(readable, *args, **kwargs)` Parse HTML or XML readable.
| `parseString(st, *args, **kw)`
| ``parseXML`(readable)` Parse an XML readable object.
| ``parseXMLString`(st)` Parse an XML readable object.
| ``unescape`(text)` Perform the exact opposite of 'escape'.
| `_unescapeDict(d)`

Variable Summary
`int` | `dictsAreNotSequences`
`tuple` | `ESCAPE_CHARS`
`_Feature` | `nested_scopes`
`tuple` | `StringTypes`

Function Details

### escape(text) Escape a few HTML special chars with HTML entities.

### parse(readable, *args, **kwargs) Parse HTML or XML readable.

### parseXML(readable) Parse an XML readable object.

### parseXMLString(st) Parse an XML readable object.

### unescape(text) Perform the exact opposite of 'escape'.

Variable Details

    ### dictsAreNotSequences Type: `int` Value:
        0

    ### ESCAPE_CHARS Type: `tuple` Value:
        (('&', '&amp;'), ('<', '&lt;'), ('>', '&gt;'), ('"', '&quot;'))

    ### nested_scopes Type: `_Feature` Value:
        _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), 16)

    ### StringTypes Type: `tuple` Value:
        (<type 'str'>, <type 'unicode'>)

Generated by Epydoc 1.1 on Thu May 8 13:19:07 2003 | http://epydoc.sf.net