Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`web`.`sux`.`XMLParser``

class documentation

`class XMLParser(Protocol): (source)`

Known subclasses: `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

View In Hierarchy

Undocumented

Method | `begin_afterslash` | Undocumented
Method | `begin_attrname` | Undocumented
Method | `begin_attrval` | Undocumented
Method | `begin_beforeeq` | Undocumented
Method | `begin_bodydata` | Undocumented
Method | `begin_comment` | Undocumented
Method | `begin_doctype` | Undocumented
Method | `begin_entityref` | Undocumented
Method | `begin_expectcdata` | Undocumented
Method | `begin_messyattr` | Undocumented
Method | `begin_spacebodydata` | Undocumented
Method | `begin_tagstart` | Undocumented
Method | `begin_unentity` | Undocumented
Method | `begin_waitscriptendtag` | Undocumented
Method | `connectionLost` | End the last state we were in.
Method | `connectionMade` | Called when a connection is made.
Method | `dataReceived` | Called whenever data is received.
Method | `do_afterslash` | Undocumented
Method | `do_attrname` | Undocumented
Method | `do_attrs` | Undocumented
Method | `do_attrval` | Undocumented
Method | `do_beforeattrval` | Undocumented
Method | `do_beforeeq` | Undocumented
Method | `do_begin` | Undocumented
Method | `do_bodydata` | Undocumented
Method | `do_cdata` | Undocumented
Method | `do_comment` | Undocumented
Method | `do_doctype` | Undocumented
Method | `do_entityref` | Undocumented
Method | `do_expectcdata` | Undocumented
Method | `do_messyattr` | Undocumented
Method | `do_tagstart` | Undocumented
Method | `do_unentity` | Undocumented
Method | `do_waitforendscript` | Undocumented
Method | `do_waitforgt` | Undocumented
Method | `do_waitscriptendtag` | Undocumented
Method | `end_attrval` | Undocumented
Method | `end_bodydata` | Undocumented
Method | `end_cdata` | Undocumented
Method | `end_doctype` | Undocumented
Method | `end_entityref` | Undocumented
Method | `end_messyattr` | Undocumented
Method | `end_unentity` | Undocumented
Method | `gotCData` | Encountered CDATA
Method | `gotComment` | Encountered comment.
Method | `gotDoctype` | Encountered DOCTYPE
Method | `gotEntityReference` | Encountered mnemonic entity reference
Method | `gotTagEnd` | Encountered closing tag
Method | `gotTagStart` | Encountered an opening tag.
Method | `gotText` | Encountered text
Method | `maybeBodyData` | Undocumented
Method | `saveMark` | Get the line number and column of the last character parsed
Class Variable | `beExtremelyLenient` | Undocumented
Class Variable | `filename` | Undocumented
Instance Variable | `attrname` | Undocumented
Instance Variable | `attrval` | Undocumented
Instance Variable | `bodydata` | Undocumented
Instance Variable | `cdatabuf` | Undocumented
Instance Variable | `colno` | Undocumented
Instance Variable | `commentbuf` | Undocumented
Instance Variable | `doctype` | Undocumented
Instance Variable | `encodings` | Undocumented
Instance Variable | `endtag` | Undocumented
Instance Variable | `erefbuf` | Undocumented
Instance Variable | `erefextra` | Undocumented
Instance Variable | `lineno` | Undocumented
Instance Variable | `quotetype` | Undocumented
Instance Variable | `state` | Undocumented
Instance Variable | `tagAttributes` | Undocumented
Instance Variable | `tagName` | Undocumented
Instance Variable | `temptagdata` | Undocumented
Instance Variable | `termtag` | Undocumented
Method | `_buildStateTable` | Return a dictionary of begin, do, end state function tuples
Method | `_decode` | Undocumented
Method | `_parseError` | Undocumented
Instance Variable | `_after_slash_closed` | Undocumented
Instance Variable | `_attrname_termtag` | Undocumented
Instance Variable | `_beforeeq_termtag` | Undocumented
Instance Variable | `_leadingBodyData` | Undocumented
Instance Variable | `_prepend` | Undocumented

Inherited from `Protocol`:

Method | `logPrefix` | Return a prefix matching the class name, to identify log messages related to this protocol instance.
Class Variable | `factory` | Undocumented

Inherited from `BaseProtocol` (via `Protocol`):

Method | `makeConnection` | Make a connection to a transport and a server.
Instance Variable | `connected` | Undocumented
Instance Variable | `transport` | Undocumented

def begin_afterslash(self, byte): (source)

Undocumented

def begin_attrname(self, byte): (source)

Undocumented

def begin_attrval(self, byte): (source)

Undocumented

def begin_beforeeq(self, byte): (source)

Undocumented

def begin_bodydata(self, byte): (source)

Undocumented

def begin_comment(self, byte): (source)

Undocumented

def begin_doctype(self, byte): (source)

Undocumented

def begin_entityref(self, byte): (source)

Undocumented

def begin_expectcdata(self, byte): (source)

Undocumented

def begin_messyattr(self, byte): (source)

Undocumented

def begin_spacebodydata(self, byte): (source)

Undocumented

def begin_tagstart(self, byte): (source)

Undocumented

def begin_unentity(self, byte): (source)

Undocumented

def begin_waitscriptendtag(self, byte): (source)

Undocumented

def connectionLost(self, reason): (source)
from `twisted.internet.interfaces.IProtocol`
overrides `twisted.internet.protocol.Protocol.connectionLost`
overridden in `twisted.web.microdom.MicroDOMParser`

End the last state we were in.

def connectionMade(self): (source)
from `twisted.internet.interfaces.IProtocol`
overrides `twisted.internet.protocol.BaseProtocol.connectionMade`

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

def dataReceived(self, data): (source)
from `twisted.internet.interfaces.IProtocol`
overrides `twisted.internet.protocol.Protocol.dataReceived`

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.

Parameters
data | a string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time.

def do_afterslash(self, byte): (source)

Undocumented

def do_attrname(self, byte): (source)

Undocumented

def do_attrs(self, byte): (source)

Undocumented

def do_attrval(self, byte): (source)

Undocumented

def do_beforeattrval(self, byte): (source)

Undocumented

def do_beforeeq(self, byte): (source)

Undocumented

def do_begin(self, byte): (source)

Undocumented

def do_bodydata(self, byte): (source)

Undocumented

def do_cdata(self, byte): (source)

Undocumented

def do_comment(self, byte): (source)

Undocumented

def do_doctype(self, byte): (source)

Undocumented

def do_entityref(self, byte): (source)

Undocumented

def do_expectcdata(self, byte): (source)

Undocumented

def do_messyattr(self, byte): (source)

Undocumented

def do_tagstart(self, byte): (source)

Undocumented

def do_unentity(self, byte): (source)

Undocumented

def do_waitforendscript(self, byte): (source)

Undocumented

def do_waitforgt(self, byte): (source)

Undocumented

def do_waitscriptendtag(self, byte): (source)

Undocumented

def end_attrval(self): (source)

Undocumented

def end_bodydata(self): (source)

Undocumented

def end_cdata(self): (source)

Undocumented

def end_doctype(self): (source)

Undocumented

def end_entityref(self): (source)

Undocumented

def end_messyattr(self): (source)

Undocumented

def end_unentity(self): (source)

Undocumented

def gotCData(self, cdata): (source)
overridden in `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

Encountered CDATA

Default behaviour is to call the gotText method

def gotComment(self, comment): (source)
overridden in `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

Encountered comment.

Default behaviour is to ignore.

def gotDoctype(self, doctype): (source)
overridden in `twisted.web.microdom.MicroDOMParser`

Encountered DOCTYPE

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

def gotEntityReference(self, entityRef): (source)
overridden in `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

Encountered mnemonic entity reference

Default behaviour is to print.

def gotTagEnd(self, name): (source)
overridden in `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

Encountered closing tag

Default behaviour is to print.

def gotTagStart(self, name, attributes): (source)
overridden in `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

Encountered an opening tag.

Default behaviour is to print.

def gotText(self, data): (source)
overridden in `twisted.web.microdom.MicroDOMParser`, `twisted.words.xish.domish.SuxElementStream`

Encountered text

Default behaviour is to print.

def maybeBodyData(self): (source)

Undocumented

def saveMark(self): (source)

Get the line number and column of the last character parsed

beExtremelyLenient: `int` = (source)
overridden in `twisted.web.microdom.MicroDOMParser`

Undocumented

filename: `str` = (source)

Undocumented

attrname: `str` = (source)

Undocumented

attrval = (source)

Undocumented

bodydata = (source)

Undocumented

cdatabuf: `str` = (source)

Undocumented

colno: `int` = (source)

Undocumented

commentbuf: `str` = (source)

Undocumented

doctype = (source)

Undocumented

encodings: `list` = (source)

Undocumented

endtag: `bool` = (source)

Undocumented

erefbuf: `str` = (source)

Undocumented

erefextra = (source)

Undocumented

lineno: `int` = (source)

Undocumented

quotetype = (source)

Undocumented

state = (source)

Undocumented

tagAttributes: `dict` = (source)

Undocumented

tagName: `str` = (source)

Undocumented

temptagdata: `str` = (source)

Undocumented

termtag: `int` = (source)

Undocumented

def _buildStateTable(self): (source)

Return a dictionary of begin, do, end state function tuples

def _decode(self, data): (source)

Undocumented

def _parseError(self, message): (source)

Undocumented

_after_slash_closed: `int` = (source)

Undocumented

_attrname_termtag: `int` = (source)

Undocumented

_beforeeq_termtag: `int` = (source)

Undocumented

_leadingBodyData = (source)

Undocumented

_prepend = (source)

Undocumented