class documentation

class _ToStan(handler.ContentHandler, handler.EntityResolver): (source)

View In Hierarchy

A SAX parser which converts an XML document to the Twisted STAN Document Object Model.

Method __init__
Instance Variable sourceFilename Undocumented
Instance Variable prefixMap Undocumented
Instance Variable inCDATA Undocumented
Method setDocumentLocator Set the document locator, which knows about line and character numbers.
Instance Variable locator Undocumented
Method startDocument Initialise the document.
Instance Variable document Undocumented
Instance Variable current Undocumented
Instance Variable stack Undocumented
Instance Variable xmlnsAttrs Undocumented
Method endDocument Document ended.
Method processingInstruction Processing instructions are ignored.
Method startPrefixMapping Set up the prefix mapping, which maps fully qualified namespace URIs onto namespace prefixes.
Method endPrefixMapping "Pops the stack" on the prefix mapping.
Method startElementNS Gets called when we encounter a new xmlns attribute.
Method characters Called when we receive some characters. CDATA characters get passed through as is.
Method endElementNS A namespace tag is closed. Pop the stack, if there's anything left in it, otherwise return to the document's namespace.
Method startDTD DTDs are ignored.
Method endDTD DTDs are ignored.
Method startCDATA We're starting to be in a CDATA element, make a note of this.
Method endCDATA We're no longer in a CDATA element. Collect up the characters we've parsed and put them in a new CDATA object.
Method comment Add an XML comment which we've encountered.
def __init__(self, sourceFilename): (source)
ParameterssourceFilenamethe filename to load the XML out of.
sourceFilename = (source)

Undocumented

prefixMap = (source)

Undocumented

inCDATA = (source)

Undocumented

(type: bool)
def setDocumentLocator(self, locator): (source)

Set the document locator, which knows about line and character numbers.

locator = (source)

Undocumented

def startDocument(self): (source)

Initialise the document.

document = (source)

Undocumented

(type: list)
current = (source)

Undocumented

stack = (source)

Undocumented

(type: list)
xmlnsAttrs = (source)

Undocumented

(type: list)
def endDocument(self): (source)

Document ended.

def processingInstruction(self, target, data): (source)

Processing instructions are ignored.

def startPrefixMapping(self, prefix, uri): (source)

Set up the prefix mapping, which maps fully qualified namespace URIs onto namespace prefixes.

This gets called before startElementNS whenever an xmlns attribute is seen.

def endPrefixMapping(self, prefix): (source)

"Pops the stack" on the prefix mapping.

Gets called after endElementNS.

def startElementNS(self, namespaceAndName, qname, attrs): (source)

Gets called when we encounter a new xmlns attribute.

ParametersnamespaceAndNamea (namespace, name) tuple, where name determines which type of action to take, if the namespace matches TEMPLATE_NAMESPACE.
qnameignored.
attrsattributes on the element being started.
def characters(self, ch): (source)

Called when we receive some characters. CDATA characters get passed through as is.

ParameterschUndocumented (type: string)
def endElementNS(self, name, qname): (source)

A namespace tag is closed. Pop the stack, if there's anything left in it, otherwise return to the document's namespace.

def startDTD(self, name, publicId, systemId): (source)

DTDs are ignored.

def endDTD(self, *args): (source)

DTDs are ignored.

def startCDATA(self): (source)

We're starting to be in a CDATA element, make a note of this.

def endCDATA(self): (source)

We're no longer in a CDATA element. Collect up the characters we've parsed and put them in a new CDATA object.

def comment(self, content): (source)

Add an XML comment which we've encountered.

API Documentation for Twisted, generated by pydoctor 21.2.0 at 2021-02-28 21:00:42.