-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Trying to parse an XML file with a schema that contains a choice sequence:
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="Title" type="xs:string" />
<xs:element name="Subtitle" type="xs:string" />
<xs:element name="Html" type="xs:string" />
<xs:element name="Vimeo" type="VimeoPart" />
<xs:element name="Youtube" type="YoutubePart" />
<xs:element name="Soundcloud" type="SoundcloudPart" />
<xs:element name="Image" type="ImagePart" />
<xs:element name="Link" type="LinkPart" />
</xs:choice>
The above generates the following in a type:
Html: string[];
Image: ImagePart[];
Link: LinkPart[];
Soundcloud: SoundcloudPart[];
Subtitle: string[];
Title: string[];
Vimeo: VimeoPart[];
Youtube: YoutubePart[];
However, this structure loses the ordering of the elements. In my case, order is important because it contains site content.
I would have expected the following types, perhaps:
choices: (Html | Image | Link | Soundcloud | Subtitle | Title | Vimeo | Youtube)[]
oberbeck
Metadata
Metadata
Assignees
Labels
No labels