xsdata.parser module¶
-
class
xsdata.parser.
SchemaParser
(name_generator=<function camel_case>, cache=<factory>, index=<factory>, target_namespace=None)[source]¶ Bases:
xsdata.formats.dataclass.parsers.XmlParser
-
name_generator
()¶ A simple parser to convert an xsd schema to an easy to handle data structure based on dataclasses.
The parser is a dummy as possible but it will try to normalize certain things like apply parent properties to children.
- Return type
-
element_form
: Optional[xsdata.models.enums.FormType] = None¶
-
attribute_form
: Optional[xsdata.models.enums.FormType] = None¶
-
target_namespace
: Optional[str] = None¶
-
end_node
(element)[source]¶ Override parent method to skip empty elements and to set the object index.
- Return type
Optional
[~T]
-
start_schema
(element, item)[source]¶ Collect the schema’s default form for attributes and elements for later usage.
-
end_schema
(obj, element)[source]¶ Collect the schema’s default form for attributes and elements for later usage.
-
end_element
(obj, element)[source]¶ Assign the schema’s default form for elements if the given element form is None.
-
end_attribute
(obj, element)[source]¶ Assign the schema’s default form for attributes if the given attribute form is None.
-
static
end_choice
(obj, element)[source]¶ Elements inside a choice are by definition optional, reset their min occurs counter.
-
static
end_all
(obj, element)[source]¶ Elements inside an all element can by definition appear at most once, reset their max occur counter.
-