xsdata.formats.dataclass.models.generics module¶
-
class
xsdata.formats.dataclass.models.generics.
AnyElement
(qname=None, text=None, tail=None, ns_map=<factory>, children=<factory>, attributes=<factory>)[source]¶ Bases:
object
Generic ElementNode dataclass to bind xml document data to wildcard fields.
- Parameters
-
qname
: Optional[lxml.etree.QName] = None¶
-
ns_map
: Dict¶
-
attributes
: Dict¶
-
class
xsdata.formats.dataclass.models.generics.
Namespaces
[source]¶ Bases:
object
Namespaces container used during parsing or generating xml documents.
- Parameters
data – Namespace to prefixes map
auto_ns – Current auto increment prefix id
_ns_map – Prefix to namespace cache auto generated if the data change.
-
data
: Dict¶
-
add
(uri, prefix=None)[source]¶ Add the given uri and optional prefix to the data storage.
If the prefix is missing and the uri exists in the storage skip the process.
If the namespace is one of the common use the predefined prefix to follow the lxml convention.
If the prefix is none assign the next auto increment prefix ns0,ns1,ns2 …