XmlEventHandler#

class xsdata.formats.dataclass.parsers.handlers.XmlEventHandler(parser, clazz)[source]#

A native xml event handler.

parse(source)[source]#

Parse the source XML document.

Parameters:

source (Any) – The xml source, can be a file resource or an input stream, or a xml tree/element.

Return type:

Any

Returns:

An instance of the class type representing the parsed content.

process_context(context)[source]#

Iterate context and push events to main parser.

Parameters:

context (Iterable[Tuple[str, Any]]) – The iterable xml context

Return type:

Any

Returns:

An instance of the class type representing the parsed content.

merge_parent_namespaces(ns_map)#

Merge the given prefix-URI map with the parent node map.

This method also registers new prefixes with the parser.

Parameters:

ns_map (Dict[Optional[str], str]) – The current element namespace prefix-URI map

Return type:

Dict

Returns:

The new merged namespace prefix-URI map.