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__
Method characters Called when we receive some characters. CDATA characters get passed through as is.
Method comment Add an XML comment which we've encountered.
Method end​CDATA We're no longer in a CDATA element. Collect up the characters we've parsed and put them in a new CDATA object.
Method end​Document Document ended.
Method end​DTD DTDs are ignored.
Method end​Element​NS A namespace tag is closed. Pop the stack, if there's anything left in it, otherwise return to the document's namespace.
Method end​Prefix​Mapping "Pops the stack" on the prefix mapping.
Method processing​Instruction Processing instructions are ignored.
Method set​Document​Locator Set the document locator, which knows about line and character numbers.
Method start​CDATA We're starting to be in a CDATA element, make a note of this.
Method start​Document Initialise the document.
Method start​DTD DTDs are ignored.
Method start​Element​NS Gets called when we encounter a new xmlns attribute.
Method start​Prefix​Mapping Set up the prefix mapping, which maps fully qualified namespace URIs onto namespace prefixes.
Instance Variable current Undocumented
Instance Variable document Undocumented
Instance Variable in​CDATA Undocumented
Instance Variable locator Undocumented
Instance Variable prefix​Map Undocumented
Instance Variable source​Filename Undocumented
Instance Variable stack Undocumented
Instance Variable xmlns​Attrs Undocumented
def __init__(self, sourceFilename): (source)
Parameters
source​Filename:Optional[str]the filename the XML was loaded out of.
def characters(self, ch): (source)
Called when we receive some characters. CDATA characters get passed through as is.
Parameters
ch:strUndocumented
def comment(self, content): (source)
Add an XML comment which we've encountered.
Parameters
content:strUndocumented
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 endDocument(self): (source)
Document ended.
def endDTD(self, *args): (source)
DTDs are ignored.
Parameters
*args:objectUndocumented
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.
Parameters
name:Tuple[str, str]Undocumented
qname:Optional[str]Undocumented
def endPrefixMapping(self, prefix): (source)

"Pops the stack" on the prefix mapping.

Gets called after endElementNS.

Parameters
prefix:Optional[str]Undocumented
def processingInstruction(self, target, data): (source)
Processing instructions are ignored.
Parameters
target:strUndocumented
data:strUndocumented
def setDocumentLocator(self, locator): (source)
Set the document locator, which knows about line and character numbers.
Parameters
locator:LocatorUndocumented
def startCDATA(self): (source)
We're starting to be in a CDATA element, make a note of this.
def startDocument(self): (source)
Initialise the document.
def startDTD(self, name, publicId, systemId): (source)
DTDs are ignored.
Parameters
name:strUndocumented
public​Id:strUndocumented
system​Id:strUndocumented
def startElementNS(self, namespaceAndName, qname, attrs): (source)
Gets called when we encounter a new xmlns attribute.
Parameters
namespace​And​Name:Tuple[str, str]a (namespace, name) tuple, where name determines which type of action to take, if the namespace matches TEMPLATE_NAMESPACE.
qname:Optional[str]ignored.
attrs:Mapping[Tuple[Optional[str], str], str]attributes on the element being started.
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.

Parameters
prefix:Optional[str]Undocumented
uri:strUndocumented
current = (source)

Undocumented

document: List[Any] = (source)

Undocumented

inCDATA: bool = (source)

Undocumented

locator = (source)

Undocumented

prefixMap = (source)

Undocumented

sourceFilename = (source)

Undocumented

stack: List[Any] = (source)

Undocumented

xmlnsAttrs: list = (source)

Undocumented