XML parser for complex Python attributes (dictionaries, lists, blobs).
Parses XML documents into Python data structures using expat. Used internally by ZMS for importing attribute values.
| Method | __init__ |
Constructor. |
| Method | |
Handle character data from the XML parser. |
| Method | |
Handle an XML comment (ignored). |
| Method | |
Handle end of a CDATA section. |
| Method | |
Handle the end of an XML element. |
| Method | |
Handle end of a namespace declaration (ignored). |
| Method | |
Handle a processing instruction (ignored). |
| Method | |
Handle start of a CDATA section. |
| Method | |
Handle the start of an XML element. |
| Method | |
Handle start of a namespace declaration (ignored). |
| Method | parse |
Parse a given XML document into Python data structures. |
| Class Variable | i |
Undocumented |
| Instance Variable | b |
Undocumented |
| Instance Variable | d |
Undocumented |
| Instance Variable | d |
Undocumented |
Handle character data from the XML parser.
Appends character data to the current tag's cdata buffer.
| Parameters | |
| s | Character data string |
Handle the end of an XML element.
Pops the current tag from the stack, processes its content depending on element type (data or item), and updates the value stack accordingly.
| Parameters | |
| s | Element (tag) name |
| Raises | |
ParseError | If end tag does not match the expected start tag |
Handle a processing instruction (ignored).
| Parameters | |
| target:str | Processing instruction target |
| data:str | Processing instruction data |
Handle the start of an XML element.
Called by the expat parser on occurrence of an XML start tag. Pushes a new tag onto the tag stack and, for container elements (data, dictionary, list), pushes an initial value onto the value stack.
| Parameters | |
| s | Element (tag) name |
| d | Dictionary of element attributes |
Handle start of a namespace declaration (ignored).
| Parameters | |
| prefix:str | Namespace prefix |
| uri:str | Namespace URI |
Parse a given XML document into Python data structures.
| Parameters | |
| input:bytes or file-like | XML document as string or file object |
| Returns | |
| Parsed value (dict, list, or blob), or None if nothing was parsed | |
| Raises | |
ParseError | If the XML document contains syntax errors |