Is there a way to enforce the standard isA relationship in an xmlSchema?
so something like
<complextype name="item">
#can be one of
<element type="desktop computer"/>
<element type="laptop"/>
<element type="smartphone"/>
</complextype>
The whole idea being that an element of type=”desktop computer” can have entirely different members compared to that of say type=”smartphone”
It’s basically trying for something similar to the grammar :-
itemlist = item | item . itemlist
item = common_desc . (desktop_computer | laptop | smartphone)
desktop_computer = monitor_specs . cabinet_dimensions . blah
smartphone = carrier . 3g_enabled . blah_blah
and so on…
I know that this sounds like a fairly contrived example and you may argue that I would need to define a new type for each item_type… but let’s assume that this is a very limited set of types…
Or you could take the example from the other question on isA relationships about feeds (Recovering types through an Isa relationship )
You can use xs:choice like this :-