XmlSaxHandler

class xsdata.formats.dataclass.parsers.handlers.XmlSaxHandler(parser, clazz, queue=<factory>, objects=<factory>)[source]

Sax content handler based on native python.

Parameters
parse(source)[source]

Parse an XML document from a system identifier or an InputSource.

Raises

XmlHandlerError – If process xinclude config is enabled.

Parameters

source (Any) –

Return type

Any

startElementNS(name, qname, attrs)[source]

Start element notification receiver.

The receiver will flush any previous active element, append a new data frame to collect data content for the next active element and notify the main parser to prepare for next binding instruction.

Converts name and attribute keys to fully qualified tags to respect the main parser api, eg (foo, bar) -> {foo}bar

Parameters
endElementNS(name, qname)[source]

End element notification receiver.

The receiver will flush any previous active element and set the next element to be flushed.

Converts name and attribute keys to fully qualified tags to respect the ain parser api, eg (foo, bar) -> {foo}bar

Parameters
  • name (Tuple) – Namespace-name tuple

  • qname (Any) – Not used

characters(content)[source]

Proxy for the data notification receiver.

Parameters

content (str) – Text or tail content

startPrefixMapping(prefix, uri)[source]

Start element prefix-URI namespace mapping.

Parameters
  • prefix (str) – Namespace prefix

  • uri (str) – Namespace uri