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

Damon Southworth xsd at cloudydaze.co.uk
Fri Oct 11 04:35:20 EDT 2013


Hi Boris,

>
> On 10 Oct 2013, at 18:21, Boris Kolpackov <boris at codesynthesis.com> wrote:
>
> 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

Right, I see what you mean now. I hadn't used substitutionGroup before. 
That should work to allow me to generate code to read the syntactically 
eqivalent xml.

Thanks,

Damon.



-- 
Damon Southworth



More information about the xsd-users mailing list