XmlHandler#

class xsdata.formats.dataclass.parsers.mixins.XmlHandler(parser, clazz)[source]#

Abstract content handler.

Parameters:
  • parser (PushParser) – The parser instance to feed with events

  • clazz (Optional[Type]) – The target class type, auto locate if omitted

queue#

The XmlNode queue list

objects#

The list of intermediate parsed objects

parse(source)[source]#

Parse the source XML document.

Parameters:

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

Return type:

Any

Returns:

An instance of the class type representing the parsed content.

merge_parent_namespaces(ns_map)[source]#

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.