[xsd-users] Support for a sequence of choice elements of polymorphic type

Boris Kolpackov boris at codesynthesis.com
Thu Oct 10 13:21:53 EDT 2013


Hi Damon,

Damon Southworth <xsd at cloudydaze.co.uk> writes:

> Yes, I already tried this and it does works but does it not
> also means that the xml source needs to change too?

No, the two schemas are semantically equivalent from the XML
instance point of view.


> Originally the xml source would look like this:
> 
> <MyListType>
>     <Element_A name="Element_A"/>
>     <Element_B name="Element_B"/>
>     ...
> </MyListType>
> 
> whereas now it would look like this
> 
> <MyListType>
>     <Element_Type name="Element_A"/ xsi:type="Element_A">
>     <Element_Type name="Element_B"/ xsi:type="Element_B">
>     ...
> </MyListType>
> 
> thus moving the list element type mapping from the schema into the
> xml source?

No, if you use a substitution group, then you don't need xsi:type.

Boris



More information about the xsd-users mailing list