I'm working on an XSD. I'd like to have a container element (complex type) which contains any element whose base type is component.
One approach is...
<complexType name="Container">
<sequence>
<element name="Child" type="am:Component"></element>
</sequence>
</complexType>
But the problem there is my components are called children. Lets assume I have 3 components, foo, bar, and baz. I'd like to be able to make a document that looked like...
<container>
<foo fooTag="foo"/>
<foo fooTag="foo"/>
<baz bazTag="baz"/>
<bar barTag="bar"/>
</container>
With the first approach I'd end up with...
<container>
<child fooTag="foo"/>
<child fooTag="foo"/>
<child bazTag="baz"/>
<child barTag="bar"/>
</container>
I could simply use an xs:any element but then I would lose my assertion that the child must be a component. Is there a way I can get what I want?