xsdata.builder module¶
-
class
xsdata.builder.
ClassBuilder
(schema, package)[source]¶ Bases:
object
-
schema
: Schema = None¶
-
package
: str = None¶
-
build_class_attributes
(obj, target)[source]¶ Build the target class attributes from the given ElementBase children.
-
build_class_extensions
(obj, target)[source]¶ Build the item class extensions from the given ElementBase children.
-
element_children
(obj, restrictions=None)[source]¶ Recursively find and return all child elements that are qualified to be class attributes.
- Return type
Iterator
[Tuple
[Union
[Attribute
,Element
,Restriction
,Enumeration
,Union
,List
,SimpleType
],Restrictions
]]
-
element_namespace
(obj)[source]¶ Return the target namespace for the given schema element.
- In order:
elements/attributes with specific target namespace
prefixed elements returns the namespace from schema nsmap
qualified elements returns the schema target namespace
unqualified elements return an empty string
unqualified attributes return None
-
children_extensions
(obj, target)[source]¶ Recursively find and return all target’s Extension classes.
If the initial given obj has a type attribute include it in result.
-
build_class_attribute
(target, obj, parent_restrictions)[source]¶ Generate and append an attribute target to the target class.
-
build_class_attribute_types
(target, obj)[source]¶ Convert real type and anonymous inner elements to an attribute type list.
-