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 connection​Lost End the last state we were in.
Method connection​Made Called when a connection is made.
Method data​Received 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 got​CData Encountered CDATA
Method got​Comment Encountered comment.
Method got​Doctype Encountered DOCTYPE
Method got​Entity​Reference Encountered mnemonic entity reference
Method got​Tag​End Encountered closing tag
Method got​Tag​Start Encountered an opening tag.
Method got​Text Encountered text
Method maybe​Body​Data Undocumented
Method save​Mark Get the line number and column of the last character parsed
Class Variable be​Extremely​Lenient 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 tag​Attributes Undocumented
Instance Variable tag​Name Undocumented
Instance Variable temptagdata Undocumented
Instance Variable termtag Undocumented
Method _build​State​Table Return a dictionary of begin, do, end state function tuples
Method _decode Undocumented
Method _parse​Error Undocumented
Instance Variable _after​_slash​_closed Undocumented
Instance Variable _attrname​_termtag Undocumented
Instance Variable _beforeeq​_termtag Undocumented
Instance Variable _leading​Body​Data Undocumented
Instance Variable _prepend Undocumented

Inherited from Protocol:

Method log​Prefix 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 make​Connection 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)
def connectionMade(self): (source)

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)

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
dataa 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)

Encountered CDATA

Default behaviour is to call the gotText method

def gotComment(self, comment): (source)

Encountered comment.

Default behaviour is to ignore.

def gotDoctype(self, doctype): (source)

Encountered DOCTYPE

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

def gotEntityReference(self, entityRef): (source)

Encountered mnemonic entity reference

Default behaviour is to print.

def gotTagEnd(self, name): (source)

Encountered closing tag

Default behaviour is to print.

def gotTagStart(self, name, attributes): (source)

Encountered an opening tag.

Default behaviour is to print.

def gotText(self, data): (source)

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)

Undocumented

filename: str = (source)

Undocumented

attrname: str = (source)

Undocumented

attrval = (source)

Undocumented

bodydata = (source)

Undocumented

cdatabuf: str = (source)

Undocumented

colno = (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 = (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