Package twisted :: Package web :: Module microdom :: Class MicroDOMParser

[frames | no frames]

## Class MicroDOMParser

    BaseProtocol --+
                   |
            Protocol --+
                       |
               XMLParser --+
                           |
                          MicroDOMParser

Method Summary
| `__init__(self, beExtremelyLenient, caseInsensitive, preserveCase, soonClosers, laterClosers)`
| `_fixScriptElement(self, el)`
| `_getparent(self)`
| `_gotStandalone(self, factory, data)`
| `connectionLost(self, reason)`
| ``gotCData`(self, cdata)` Encountered CDATA
| `gotComment(self, data)`
| ``gotDoctype`(self, doctype)` Encountered DOCTYPE
| ``gotEntityReference`(self, entityRef)` Encountered mnemonic entity reference
| ``gotTagEnd`(self, name)` Encountered closing tag
| ``gotTagStart`(self, name, attributes)` Encountered an opening tag.
| ``gotText`(self, data)` Encountered text
| `shouldPreserveSpace(self)`
Inherited from XMLParser
| ``_buildStateTable`(self)` Return a dictionary of begin, do, end state function tuples
| ``_decode`(self, data)`
| ``_parseError`(self, message)`
| ``begin_afterslash`(self, byte)`
| ``begin_attrname`(self, byte)`
| ``begin_attrval`(self, byte)`
| ``begin_beforeeq`(self, byte)`
| ``begin_bodydata`(self, byte)`
| ``begin_comment`(self, byte)`
| ``begin_doctype`(self, byte)`
| ``begin_entityref`(self, byte)`
| ``begin_expectcdata`(self, byte)`
| ``begin_messyattr`(self, byte)`
| ``begin_spacebodydata`(self, byte)`
| ``begin_tagstart`(self, byte)`
| ``begin_waitscriptendtag`(self, byte)`
| ``connectionMade`(self)` Called when a connection is made.
| ``dataReceived`(self, data)` Called whenever data is received.
| ``do_afterslash`(self, byte)`
| ``do_attrname`(self, byte)`
| ``do_attrs`(self, byte)`
| ``do_attrval`(self, byte)`
| ``do_beforeattrval`(self, byte)`
| ``do_beforeeq`(self, byte)`
| ``do_begin`(self, byte)`
| ``do_bodydata`(self, byte)`
| ``do_cdata`(self, byte)`
| ``do_comment`(self, byte)`
| ``do_doctype`(self, byte)`
| ``do_entityref`(self, byte)`
| ``do_expectcdata`(self, byte)`
| ``do_messyattr`(self, byte)`
| ``do_spacebodydata`(self, byte)`
| ``do_tagstart`(self, byte)`
| ``do_waitforendscript`(self, byte)`
| ``do_waitforgt`(self, byte)`
| ``do_waitscriptendtag`(self, byte)`
| ``end_attrval`(self)`
| ``end_bodydata`(self)`
| ``end_cdata`(self)`
| ``end_doctype`(self)`
| ``end_entityref`(self)`
| ``end_messyattr`(self)`
| ``end_spacebodydata`(self)`
| ``maybeBodyData`(self)`
| ``saveMark`(self)` Get the line number and column of the last character parsed
Inherited from Protocol
| ``connectionFailed`(self)` (Deprecated)
Inherited from BaseProtocol
| ``makeConnection`(self, transport)` Make a connection to a transport and a server.

Class Variable Summary
`dict` | `_XMLParser__stateTable` = `{'comment': (<bound method Micr...`
`SRE_Pattern` | `COMMENT` = `\s*/[/\*]\s*`
`dict` | `laterClosers` = `{'head': ['body'], 'option': ['option'], ...`
`list` | `soonClosers` = `['area', 'link', 'br', 'img', 'hr', 'input...`
Inherited from XMLParser
`NoneType` | `_prepend` = None
`str` | `attrname` = `''`
`str` | `attrval` = `''`
`int` | `beExtremelyLenient` = 0
`NoneType` | `encodings` = None
`str` | `filename` = `'<xml />'`
`NoneType` | `state` = None
Inherited from Protocol
`tuple` | `__implements__` = `(<class twisted.internet.interfaces.IPr...`
Inherited from BaseProtocol
`int` | `connected` = 0
`NoneType` | `transport` = None

Method Details

### gotCData(self, cdata)

Encountered CDATA

Default behaviour is to call the gotText method

  Overrides:
    `twisted.protocols.sux.XMLParser.gotCData` (inherited documentation)

### gotDoctype(self, doctype)

Encountered DOCTYPE

This is really grotty: it basically just gives you everything between '<!DOCTYPE' and '>' as an argument.

  Overrides:
    `twisted.protocols.sux.XMLParser.gotDoctype` (inherited documentation)

### gotEntityReference(self, entityRef)

Encountered mnemonic entity reference

Default behaviour is to print.

  Overrides:
    `twisted.protocols.sux.XMLParser.gotEntityReference` (inherited documentation)

### gotTagEnd(self, name)

Encountered closing tag

Default behaviour is to print.

  Overrides:
    `twisted.protocols.sux.XMLParser.gotTagEnd` (inherited documentation)

### gotTagStart(self, name, attributes)

Encountered an opening tag.

Default behaviour is to print.

  Overrides:
    `twisted.protocols.sux.XMLParser.gotTagStart` (inherited documentation)

### gotText(self, data)

Encountered text

Default behaviour is to print.

  Overrides:
    `twisted.protocols.sux.XMLParser.gotText` (inherited documentation)

Class Variable Details

### _XMLParser__stateTable

  Type:
    `dict`
  Value:

        {'afterslash': (<bound method MicroDOMParser.begin_afterslash of <twis\
        ted.web.microdom.MicroDOMParser instance at 0x8684584>>,
                        <bound method MicroDOMParser.do_afterslash of <twisted\
        .web.microdom.MicroDOMParser instance at 0x8684584>>,
                        <function nop at 0x840ee54>),
         'attrname': (<bound method MicroDOMParser.begin_attrname of <twisted.\
        web.microdom.MicroDOMParser instance at 0x8684584>>,
                      <bound method MicroDOMParser.do_attrname of <twisted.web\
        ...

### COMMENT

  Type:
    `SRE_Pattern`
  Value:

        \s*/[/\*]\s*

### laterClosers

  Type:
    `dict`
  Value:

        {'col': ['col'],
         'colgroup': ['colgroup'],
         'dd': ['dt', 'dd'],
         'dt': ['dt', 'dd'],
         'head': ['body'],
         'li': ['li'],
         'option': ['option'],
         'p': ['p'],
        ...

### soonClosers

  Type:
    `list`
  Value:

        ['area', 'link', 'br', 'img', 'hr', 'input', 'base', 'meta']

Generated by Epydoc 2.0 on Sat May 15 20:07:56 2004 | http://epydoc.sf.net