You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:elementname="first">
<xs:annotation>
<xs:documentation>
Sequence is not repeating, fields are declared in the same order: do nothing
<a />
<b />
<b />
<c />
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:elementname="a"type="xs:string" />
<xs:elementname="b"type="xs:string"maxOccurs="2" />
<xs:elementname="c"type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:elementname="second">
<xs:annotation>
<xs:documentation>
Repeatable sequence of non list elements: current sequential
<a />
<b />
<c />
<a />
<b />
<c />
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequencemaxOccurs="2">
<xs:elementname="a"type="xs:string" />
<xs:elementname="b"type="xs:string" />
<xs:elementname="c"type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:elementname="third">
<xs:annotation>
<xs:documentation>
Repeatable sequence of both list and non list elements: we rely on compound fields to get it working
<a />
<a />
<b />
<c />
<c />
<a />
<a />
<b />
<c />
<c />
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequencemaxOccurs="2">
<xs:elementname="a"type="xs:string"maxOccurs="2" />
<xs:elementname="b"type="xs:string" />
<xs:elementname="c"type="xs:string"maxOccurs="2" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:elementname="fourth">
<xs:annotation>
<xs:documentation>
Whatever....Why...
<a />
<b />
<c />
<c />
<a />
<b />
<b />
<a />
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:elementname="a"type="xs:string" />
<xs:elementname="b"type="xs:string" />
<xs:elementname="c"type="xs:string"maxOccurs="2" />
<xs:sequencemaxOccurs="2">
<xs:elementname="a"type="xs:string" />
<xs:elementname="b"type="xs:string"minOccurs="0"maxOccurs="2" />
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
To get the 3-4 cases working xsdata relies on effective choices feature #433 and compound fields.
Currently the sequential metadata property is boolean and the xs:sequence min/max occurs is merged into the element's normal min/max occurs. Things get more complicated when extending types and the class analyzer tries to merge inherited restrictions.
I want to try to decouple sequence min/max occurs from the child elements min/max occurs during class analyzer, and use the sanitizer in the end to set the fields real min/max occurs values and the sequential break number.
The fourth case is all over the place and I am not sure it can even be done with dataclasses without the compound fields. Maybe turn the sequential property into a list of break points?
I was kind of excited until I reached writing down case no4, worth the effort?? I am not so sure but it still bothers me the fact that the sequence and elements min/max occurs are tight coupled.
The text was updated successfully, but these errors were encountered:
The main problem with this is that the order of the elements cannot be guaranteed. In the above case this is not problematic because business wise all the elements should be executed parallel. But in the case below, where elements should be executed by the order of the list, that would only work for the same type.
To get the 3-4 cases working xsdata relies on effective choices feature #433 and compound fields.
Currently the sequential metadata property is boolean and the xs:sequence min/max occurs is merged into the element's normal min/max occurs. Things get more complicated when extending types and the class analyzer tries to merge inherited restrictions.
I want to try to decouple sequence min/max occurs from the child elements min/max occurs during class analyzer, and use the sanitizer in the end to set the fields real min/max occurs values and the sequential break number.
The fourth case is all over the place and I am not sure it can even be done with dataclasses without the compound fields. Maybe turn the sequential property into a list of break points?
I was kind of excited until I reached writing down case no4, worth the effort?? I am not so sure but it still bothers me the fact that the sequence and elements min/max occurs are tight coupled.
The text was updated successfully, but these errors were encountered: