class documentation
Generic XML builder for constructing ZMS object trees.
The builder wires expat parser callbacks to object-creation and object-update hooks implemented by ZMS node classes.
| Method | __init__ |
Initialize builder state. |
| Method | |
Handle character data parsed by expat. |
| Method | |
Handle an XML comment. |
| Method | |
Handle the end of a CDATA section. |
| Method | |
Handle the end of an XML element. |
| Method | |
Handle the end of a namespace declaration. |
| Method | |
Handle a processing instruction. |
| Method | |
Handle the start of a CDATA section. |
| Method | |
Handle the start of an XML element. |
| Method | |
Handle the start of a namespace declaration. |
| Method | parse |
Parse an XML document and build a recursive object tree. |
| Class Variable | i |
Undocumented |
| Instance Variable | b |
Undocumented |
| Instance Variable | o |
Undocumented |
| Instance Variable | o |
Undocumented |
| Instance Variable | o |
Undocumented |
Handle the end of an XML element.
Finalizes the current node or delegates unknown end tags to the current node.
| Parameters | |
| name:str | Element name |
| Raises | |
ParseError | If an unknown end tag cannot be handled |
Handle the end of a namespace declaration.
Namespace declarations are ignored by this builder.
| Parameters | |
| prefix:str | Namespace prefix |
Handle a processing instruction.
Processing instructions are ignored by this builder.
| Parameters | |
| target:str | Processing instruction target |
| data:str | Processing instruction data |
Handle the start of an XML element.
Creates a new node for known meta objects or forwards unknown tags to the current node.
| Parameters | |
| name:str | Element name |
| attrs:dict | Dictionary of element attributes |
Handle the start of a namespace declaration.
Namespace declarations are ignored by this builder.
| Parameters | |
| prefix:str | Namespace prefix |
| uri:str | Namespace URI |
Parse an XML document and build a recursive object tree.
| Parameters | |
| input:bytes or file-like | XML document as bytes or file-like object |
| root:object | Optional pre-existing root node |
| b | Flag indicating parsing starts inside an existing root tag |
| Returns | |
| Last parsed node or root object | |
| Raises | |
ParseError | If the XML document contains syntax errors |