mamift / LinqToXsdCore

LinqToXsd ported to .NET Core (targets .NET Standard 2 for generated code and .NET Core 3.1, .NET 5+ for the code generator CLI tool).
Microsoft Public License
41 stars 15 forks source link

maxOccurs="unbounded", is not respected for elements in choice block #42

Open ttjorvi opened 2 years ago

ttjorvi commented 2 years ago

When adding a second Document element to a MsgHead element defined in the following schema:

    <element name="MsgHead">
        <complexType>
            <sequence>
                <element ref="mh:MsgInfo"/>
                <choice>
                    <element ref="mh:Document" maxOccurs="unbounded"/>
                    <element ref="mh:PatientReport" maxOccurs="unbounded">
                        <annotation>
                            <documentation>xxx</documentation>
                        </annotation>
                    </element>
                </choice>
                <element ref="ds:Signature" minOccurs="0"/>
            </sequence>
        </complexType>
    </element>

the previous entry is removed.

This is happening in .\LinqToXsdCore\XObjectsCore\API\ChoiceContentModelEntity.cs when a call is made to this.RemoveChoices (line 20).

The maxOccurs="unbounded" does not seem to be respected.