LinqToXsdCore icon indicating copy to clipboard operation
LinqToXsdCore copied to clipboard

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

Open ttjorvi opened this issue 3 years ago • 0 comments
trafficstars

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.

ttjorvi avatar Apr 06 '22 16:04 ttjorvi