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`.`_template_util`.`_ToStan``

class documentation

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

Constructor: `_ToStan(sourceFilename)`

View In Hierarchy

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

Method | `__init__` | No summary
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 | `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 | `endDocument` | Document ended.
Method | `endDTD` | DTDs are ignored.
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 | `endPrefixMapping` | "Pops the stack" on the prefix mapping.
Method | `processingInstruction` | Processing instructions are ignored.
Method | `setDocumentLocator` | Set the document locator, which knows about line and character numbers.
Method | `startCDATA` | We're starting to be in a CDATA element, make a note of this.
Method | `startDocument` | Initialise the document.
Method | `startDTD` | DTDs are ignored.
Method | `startElementNS` | Gets called when we encounter a new xmlns attribute.
Method | `startPrefixMapping` | Set up the prefix mapping, which maps fully qualified namespace URIs onto namespace prefixes.
Instance Variable | `current` | Undocumented
Instance Variable | `document` | Undocumented
Instance Variable | `inCDATA` | Undocumented
Instance Variable | `locator` | Undocumented
Instance Variable | `prefixMap` | Undocumented
Instance Variable | `sourceFilename` | Undocumented
Instance Variable | `stack` | Undocumented
Instance Variable | `xmlnsAttrs` | Undocumented

def __init__(self, sourceFilename: `Optional[str]`): (source)

Parameters
sourceFilename:`Optional[str]` | the filename the XML was loaded out of.

def characters(self, ch: `str`): (source)

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

def comment(self, content: `str`): (source)

Add an XML comment which we've encountered.

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: `object`): (source)

DTDs are ignored.

def endElementNS(self, name: `Tuple[str, str]`, qname: `Optional[str]`): (source)

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

def endPrefixMapping(self, prefix: `Optional[str]`): (source)

"Pops the stack" on the prefix mapping.

Gets called after endElementNS.

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

Processing instructions are ignored.

def setDocumentLocator(self, locator: `Locator`): (source)

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

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: `str`, publicId: `str`, systemId: `str`): (source)

DTDs are ignored.

def startElementNS(self, namespaceAndName: `Tuple[str, str]`, qname: `Optional[str]`, attrs: `AttributesNSImpl`): (source)

Gets called when we encounter a new xmlns attribute.

Parameters
namespaceAndName:`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:`AttributesNSImpl` | attributes on the element being started.

def startPrefixMapping(self, prefix: `Optional[str]`, uri: `str`): (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.

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[Tuple[str, str]]` = (source)

Undocumented