xsdata.models.xsd module

xsdata.models.xsd.attribute(default=None, init=True, **kwargs)[source]
Parameters
Return type

Any

xsdata.models.xsd.element(init=True, **kwargs)[source]
Parameters
Return type

Any

xsdata.models.xsd.array_element(init=True, **kwargs)[source]
Parameters
Return type

Any

xsdata.models.xsd.array_any_element(init=True, **kwargs)[source]
Parameters
Return type

Any

xsdata.models.xsd.occurrences(min_value, max_value)[source]
Parameters
Return type

Dict[str, int]

class xsdata.models.xsd.XmlString(elements=<factory>)[source]

Bases: object

Parameters

elements (List[object]) –

elements: Array[object]
render()[source]
Return type

str

class xsdata.models.xsd.Documentation(index=<factory>, ns_map=<factory>, lang=None, source=None, elements=<factory>, attributes=None)[source]

Bases: xsdata.models.mixins.ElementBase

Model representation of a schema xs:documentation element.

Parameters
class Meta[source]

Bases: object

mixed = True
lang: Optional[str] = None
source: Optional[str] = None
elements: Array[object]
attributes: Optional[AnyAttribute] = None
tostring()[source]
Return type

Optional[str]

class xsdata.models.xsd.Appinfo(index=<factory>, ns_map=<factory>, source=None, elements=<factory>, any_attribute=None)[source]

Bases: xsdata.models.mixins.ElementBase

Model representation of a schema xs:appinfo element.

Parameters
class Meta[source]

Bases: object

mixed = True
source: Optional[str] = None
elements: Array[object]
any_attribute: Optional[AnyAttribute] = None
class xsdata.models.xsd.Annotation(index=<factory>, ns_map=<factory>, appinfo=None, documentations=<factory>, any_attribute=None)[source]

Bases: xsdata.models.mixins.ElementBase

Model representation of a schema xs:annotation element.

Parameters
appinfo: Optional[xsdata.models.xsd.Appinfo] = None
documentations: Array[Documentation]
any_attribute: Optional[AnyAttribute] = None
class xsdata.models.xsd.AnnotationBase(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None)[source]

Bases: xsdata.models.mixins.ElementBase

Base Class for elements that can contain annotations.

Parameters
id: Optional[str] = None
annotation: Optional[xsdata.models.xsd.Annotation] = None
any_attribute: Optional[AnyAttribute] = None
property display_help

Return the display help for this element.

Return type

Optional[str]

class xsdata.models.xsd.AnyAttribute(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, namespace='##any', process_contents=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:anyAttribute element.

Parameters
namespace: Optional[str] = '##any'
process_contents: Optional[xsdata.models.enums.ProcessType] = None
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property raw_namespace

Return if present the target namespace attribute value.

Return type

Optional[str]

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

class xsdata.models.xsd.Assertion(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, test=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:assertion element.

Parameters
test: Optional[str] = None
class xsdata.models.xsd.SimpleType(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, restriction=None, list=None, union=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:simpleType element.

Parameters
name: Optional[str] = None
restriction: Optional[Restriction] = None
list: Optional[List] = None
union: Optional[Union] = None
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property is_enumeration
Return type

bool

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.List(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, simple_type=None, item_type=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:list element.

Parameters
simple_type: Optional[xsdata.models.xsd.SimpleType] = None
item_type: Optional[str] = None
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.Union(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, member_types=None, simple_types=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:union element.

Parameters
member_types: Optional[str] = None
simple_types: Array[SimpleType]
property extensions

Return an iterator of all the base types.

Return type

Iterator[str]

property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.Attribute(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, default=None, fixed=None, form=None, name=None, ref=None, type=None, target_namespace=None, simple_type=None, use=<UseType.OPTIONAL: 'optional'>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:attribute element.

Parameters
default: Optional[str] = None
fixed: Optional[str] = None
form: Optional[xsdata.models.enums.FormType] = None
name: Optional[str] = None
ref: Optional[str] = None
type: Optional[str] = None
target_namespace: Optional[str] = None
simple_type: Optional[xsdata.models.xsd.SimpleType] = None
use: Optional[xsdata.models.enums.UseType] = 'optional'
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.AttributeGroup(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, ref=None, attributes=<factory>, attribute_groups=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:attributeGroup element.

Parameters
name: Optional[str] = None
ref: Optional[str] = None
attributes: Array[Attribute]
attribute_groups: Array[‘AttributeGroup’]
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

class xsdata.models.xsd.Any(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, min_occurs=1, max_occurs=1, namespace='##any', process_contents=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:any element.

Parameters
min_occurs: int = 1
max_occurs: Union[int, str] = 1
namespace: Optional[str] = '##any'
process_contents: Optional[xsdata.models.enums.ProcessType] = None
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property raw_namespace

Return if present the target namespace attribute value.

Return type

Optional[str]

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.All(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, min_occurs=1, max_occurs=1, any=<factory>, elements=<factory>, groups=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:all element.

Parameters
min_occurs: int = 1
max_occurs: Union[int, str] = 1
any: Array[Any]
elements: Array[‘Element’]
groups: Array[‘Group’]
get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.Sequence(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, min_occurs=1, max_occurs=1, elements=<factory>, groups=<factory>, choices=<factory>, sequences=<factory>, any=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:sequence element.

Parameters
min_occurs: int = 1
max_occurs: Union[int, str] = 1
elements: Array[‘Element’]
groups: Array[‘Group’]
choices: Array[‘Choice’]
sequences: Array[‘Sequence’]
any: Array[‘Any’]
get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.Choice(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, min_occurs=1, max_occurs=1, elements=<factory>, groups=<factory>, choices=<factory>, sequences=<factory>, any=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:choice element.

Parameters
min_occurs: int = 1
max_occurs: Union[int, str] = 1
elements: Array[‘Element’]
groups: Array[‘Group’]
choices: Array[‘Choice’]
sequences: Array[Sequence]
any: Array[‘Any’]
get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.Group(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, ref=None, min_occurs=1, max_occurs=1, all=None, choice=None, sequence=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:group element.

Parameters
name: Optional[str] = None
ref: Optional[str] = None
min_occurs: int = 1
max_occurs: Union[int, str] = 1
all: Optional[xsdata.models.xsd.All] = None
choice: Optional[xsdata.models.xsd.Choice] = None
sequence: Optional[xsdata.models.xsd.Sequence] = None
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.OpenContent(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, applies_to_empty=False, mode=<Mode.INTERLEAVE: 'interleave'>, any=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:openContent element.

Parameters
applies_to_empty: bool = False
mode: xsdata.models.enums.Mode = 'interleave'
any: xsdata.models.xsd.Any = None
class xsdata.models.xsd.DefaultOpenContent(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, applies_to_empty=False, mode=<Mode.INTERLEAVE: 'interleave'>, any=None)[source]

Bases: xsdata.models.xsd.OpenContent

Model representation of a schema xs:defaultOpenContent element.

Parameters
class xsdata.models.xsd.Extension(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, base=None, group=None, all=None, choice=None, sequence=None, open_content=None, attributes=<factory>, attribute_groups=<factory>, assertions=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:extension element.

Parameters
base: Optional[str] = None
group: Optional[xsdata.models.xsd.Group] = None
all: Optional[xsdata.models.xsd.All] = None
choice: Optional[xsdata.models.xsd.Choice] = None
sequence: Optional[xsdata.models.xsd.Sequence] = None
any_attribute: Optional[xsdata.models.xsd.AnyAttribute] = None
open_content: Optional[xsdata.models.xsd.OpenContent] = None
attributes: Array[Attribute]
attribute_groups: Array[AttributeGroup]
assertions: Array[Assertion]
property extensions

Return an iterator of all the base types.

Return type

Iterator[str]

class xsdata.models.xsd.Enumeration(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:enumeration element.

Parameters
value: str = None
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

None

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property default
Return type

str

class xsdata.models.xsd.FractionDigits(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:fractionDigits element.

Parameters
value: int = None
class xsdata.models.xsd.Length(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:length element.

Parameters
value: int = None
class xsdata.models.xsd.MaxExclusive(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:maxExclusive element.

Parameters
value: float = None
class xsdata.models.xsd.MaxInclusive(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:maxInclusive element.

Parameters
value: float = None
class xsdata.models.xsd.MaxLength(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:maxLength element.

Parameters
value: float = None
class xsdata.models.xsd.MinExclusive(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:minExclusive element.

Parameters
value: float = None
class xsdata.models.xsd.MinInclusive(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:minInclusive element.

Parameters
value: float = None
class xsdata.models.xsd.MinLength(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:minLength element.

Parameters
value: float = None
class xsdata.models.xsd.Pattern(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:pattern element.

Parameters
value: str = None
class xsdata.models.xsd.TotalDigits(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:totalDigits element.

Parameters
value: int = None
class xsdata.models.xsd.WhiteSpace(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:whiteSpace element.

Parameters
value: str = None
class xsdata.models.xsd.ExplicitTimezone(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, value=None, fixed=False)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:explicitTimezone element.

Parameters
value: str = None
fixed: bool = False
class xsdata.models.xsd.Restriction(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, base=None, group=None, all=None, choice=None, sequence=None, open_content=None, attributes=<factory>, attribute_groups=<factory>, enumerations=<factory>, asserts=<factory>, assertions=<factory>, any_element=<factory>, min_exclusive=None, min_inclusive=None, min_length=None, max_exclusive=None, max_inclusive=None, max_length=None, total_digits=None, fraction_digits=None, length=None, white_space=None, patterns=<factory>, explicit_timezone=None, simple_type=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:restriction element.

Parameters
base: Optional[str] = None
group: Optional[xsdata.models.xsd.Group] = None
all: Optional[xsdata.models.xsd.All] = None
choice: Optional[xsdata.models.xsd.Choice] = None
sequence: Optional[xsdata.models.xsd.Sequence] = None
open_content: Optional[xsdata.models.xsd.OpenContent] = None
attributes: Array[Attribute]
attribute_groups: Array[AttributeGroup]
enumerations: Array[Enumeration]
asserts: Array[Assertion]
assertions: Array[Assertion]
any_element: Array[object]
min_exclusive: Optional[xsdata.models.xsd.MinExclusive] = None
min_inclusive: Optional[xsdata.models.xsd.MinInclusive] = None
min_length: Optional[xsdata.models.xsd.MinLength] = None
max_exclusive: Optional[xsdata.models.xsd.MaxExclusive] = None
max_inclusive: Optional[xsdata.models.xsd.MaxInclusive] = None
max_length: Optional[xsdata.models.xsd.MaxLength] = None
total_digits: Optional[xsdata.models.xsd.TotalDigits] = None
fraction_digits: Optional[xsdata.models.xsd.FractionDigits] = None
length: Optional[xsdata.models.xsd.Length] = None
white_space: Optional[xsdata.models.xsd.WhiteSpace] = None
patterns: Array[Pattern]
explicit_timezone: Optional[xsdata.models.xsd.ExplicitTimezone] = None
simple_type: Optional[xsdata.models.xsd.SimpleType] = None
property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

property extensions

Return an iterator of all the base types.

Return type

Iterator[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.SimpleContent(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, restriction=None, extension=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:simpleContent element.

Parameters
restriction: Optional[xsdata.models.xsd.Restriction] = None
extension: Optional[xsdata.models.xsd.Extension] = None
class xsdata.models.xsd.ComplexContent(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, restriction=None, extension=None, mixed=False)[source]

Bases: xsdata.models.xsd.SimpleContent

Model representation of a schema xs:complexContent element.

Parameters
mixed: bool = False
class xsdata.models.xsd.ComplexType(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, block=None, final=None, simple_content=None, complex_content=None, group=None, all=None, choice=None, sequence=None, open_content=None, attributes=<factory>, attribute_groups=<factory>, assertion=<factory>, abstract=False, mixed=False, default_attributes_apply=True)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:complexType element.

Parameters
name: Optional[str] = None
block: Optional[str] = None
final: Optional[str] = None
simple_content: Optional[xsdata.models.xsd.SimpleContent] = None
complex_content: Optional[xsdata.models.xsd.ComplexContent] = None
group: Optional[xsdata.models.xsd.Group] = None
all: Optional[xsdata.models.xsd.All] = None
choice: Optional[xsdata.models.xsd.Choice] = None
sequence: Optional[xsdata.models.xsd.Sequence] = None
any_attribute: Optional[xsdata.models.xsd.AnyAttribute] = None
open_content: Optional[xsdata.models.xsd.OpenContent] = None
attributes: Array[Attribute]
attribute_groups: Array[AttributeGroup]
assertion: Array[Assertion]
abstract: bool = False
mixed: bool = False
default_attributes_apply: bool = True
property is_mixed

Return whether or not this element accepts mixed content value.

Return type

bool

class xsdata.models.xsd.Field(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, xpath=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:field element.

Parameters
xpath: Optional[str] = None
class xsdata.models.xsd.Selector(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, xpath=None)[source]

Bases: xsdata.models.xsd.Field

Schema Model representation of a schema xs:selectorModel element..

Parameters
class xsdata.models.xsd.Unique(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, ref=None, selector=None, fields=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:unique element.

Parameters
name: Optional[str] = None
ref: Optional[str] = None
selector: Optional[xsdata.models.xsd.Selector] = None
fields: Array[Field]
class xsdata.models.xsd.Key(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, ref=None, selector=None, fields=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:key element.

Parameters
name: Optional[str] = None
ref: Optional[str] = None
selector: Optional[xsdata.models.xsd.Selector] = None
fields: Array[Selector]
class xsdata.models.xsd.Keyref(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, ref=None, refer=None, selector=None, fields=<factory>)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:keyref element.

Parameters
name: Optional[str] = None
ref: Optional[str] = None
refer: Optional[str] = None
selector: Optional[xsdata.models.xsd.Selector] = None
fields: Array[Selector]
class xsdata.models.xsd.Alternative(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, type=None, test=None, simple_type=None, complex_type=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:alternative element.

Parameters
type: Optional[str] = None
test: Optional[str] = None
simple_type: Optional[xsdata.models.xsd.SimpleType] = None
complex_type: Optional[xsdata.models.xsd.ComplexType] = None
property real_name

Return the real name for this element by looking by looking either to the name or ref attribute value.

Raises

SchemaValueError – when instance has no name/ref attribute.

Return type

str

class xsdata.models.xsd.Element(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, ref=None, type=None, substitution_group=None, default=None, fixed=None, form=None, block=None, final=None, target_namespace=None, simple_type=None, complex_type=None, alternatives=<factory>, uniques=<factory>, keys=<factory>, keyrefs=<factory>, min_occurs=1, max_occurs=1, nillable=False, abstract=False)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:element element.

Parameters
name: Optional[str] = None
ref: Optional[str] = None
type: Optional[str] = None
substitution_group: Optional[str] = None
default: Optional[str] = None
fixed: Optional[str] = None
form: Optional[xsdata.models.enums.FormType] = None
block: Optional[str] = None
final: Optional[str] = None
target_namespace: Optional[str] = None
simple_type: Optional[xsdata.models.xsd.SimpleType] = None
complex_type: Optional[xsdata.models.xsd.ComplexType] = None
alternatives: Array[Alternative]
uniques: Array[Unique]
keys: Array[Key]
keyrefs: Array[Keyref]
min_occurs: int = 1
max_occurs: Union[int, str] = 1
nillable: bool = False
abstract: bool = False
property is_attribute

Return whether or not this element is qualified to be a class attribute.

Return type

bool

property is_mixed

Return whether or not this element accepts mixed content value.

Return type

bool

property default_type

Return the default type if the given element has not specific type.

Return type

DataType

property raw_type

Return if present the type attribute value.

Return type

Optional[str]

property real_type

Return the real type for this element.

Raises

SchemaValueError – when attribute instance is missing implementation.

Return type

Optional[str]

property substitutions

Return the substitution groups of this element.

Return type

List[str]

get_restrictions()[source]

Return the restrictions dictionary of this element.

Return type

Dict[str, Any]

class xsdata.models.xsd.Notation(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, name=None, public=None, system=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:notation element.

Parameters
name: Optional[str] = None
public: Optional[str] = None
system: Optional[str] = None
class xsdata.models.xsd.SchemaLocation(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, location=None)[source]

Bases: xsdata.models.xsd.AnnotationBase

Model representation of a schema xs:schemaLocation element. Base schema location.

Parameters
location: Optional[str] = None
class xsdata.models.xsd.Import(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, location=None, namespace=None, schema_location=None)[source]

Bases: xsdata.models.xsd.SchemaLocation

Model representation of a schema xs:import element.

Parameters
namespace: Optional[str] = None
schema_location: Optional[str] = None
class xsdata.models.xsd.Include(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, location=None, schema_location=None)[source]

Bases: xsdata.models.xsd.SchemaLocation

Model representation of a schema xs:include element.

Parameters
schema_location: Optional[str] = None
class xsdata.models.xsd.Redefine(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, location=None, schema_location=None, simple_types=<factory>, complex_types=<factory>, groups=<factory>, attribute_groups=<factory>)[source]

Bases: xsdata.models.xsd.SchemaLocation

Model representation of a schema xs:redefine element.

Parameters
schema_location: Optional[str] = None
simple_types: Array[SimpleType]
complex_types: Array[ComplexType]
groups: Array[Group]
attribute_groups: Array[AttributeGroup]
class xsdata.models.xsd.Override(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, location=None, schema_location=None, simple_types=<factory>, complex_types=<factory>, groups=<factory>, attribute_groups=<factory>, elements=<factory>, attributes=<factory>, notations=<factory>)[source]

Bases: xsdata.models.xsd.SchemaLocation

Model representation of a schema xs:override element.

Parameters
schema_location: Optional[str] = None
simple_types: Array[SimpleType]
complex_types: Array[ComplexType]
groups: Array[Group]
attribute_groups: Array[AttributeGroup]
elements: Array[Element]
attributes: Array[Attribute]
notations: Array[Notation]
class xsdata.models.xsd.Schema(index=<factory>, ns_map=<factory>, id=None, annotation=None, any_attribute=None, location=None, target=None, block_default=None, default_attributes=None, final_default=None, target_namespace=None, version=None, xmlns=None, element_form_default=<FormType.UNQUALIFIED: 'unqualified'>, attribute_form_default=<FormType.UNQUALIFIED: 'unqualified'>, default_open_content=None, includes=<factory>, imports=<factory>, redefines=<factory>, overrides=<factory>, annotations=<factory>, simple_types=<factory>, complex_types=<factory>, groups=<factory>, attribute_groups=<factory>, elements=<factory>, attributes=<factory>, notations=<factory>)[source]

Bases: xsdata.models.xsd.SchemaLocation

Model representation of a schema xs:chema element.

Parameters
class Meta[source]

Bases: object

namespace = 'http://www.w3.org/2001/XMLSchema'
target: Optional[str] = None
block_default: Optional[str] = None
default_attributes: Optional[str] = None
final_default: Optional[str] = None
target_namespace: Optional[str] = None
version: Optional[str] = None
xmlns: Optional[str] = None
element_form_default: xsdata.models.enums.FormType = 'unqualified'
attribute_form_default: xsdata.models.enums.FormType = 'unqualified'
default_open_content: Optional[xsdata.models.xsd.DefaultOpenContent] = None
includes: Array[Include]
imports: Array[Import]
redefines: Array[Redefine]
overrides: Array[Override]
annotations: Array[Annotation]
simple_types: Array[SimpleType]
complex_types: Array[ComplexType]
groups: Array[Group]
attribute_groups: Array[AttributeGroup]
elements: Array[Element]
attributes: Array[Attribute]
notations: Array[Notation]
included()[source]
Return type

Iterator[Union[Import, Include, Redefine, Override]]

property module
Return type

str