Hi all,
I have a case where I have a element that can appear under multiple
elements
e.g.
<AppFunctions >
<UseTemplate name="1"/>
<MethodSet name="2">
<UseTemplate name="3" />
<MethodCall name="4" />
</MethodSet>
<MethodSet name="5">
<MethodCall name="6" />
</MethodSet>
<UseTemplate name="7" />
</AppFunctions>
I would like a way to define a root element which has just the
UseTemplate element and then derive 2 elements from it "AppFunctio ns"
and "MethodSet" which extend it to add further elements to it. This
elements in the derived elements need to unordered and can occur
multiple times. This is what I came up with:
<xs:complexTy pe name="UIElement Type">
<xs:choice maxOccurs="unbo unded">
<xs:element name="UseTempla te" type="UseTempla teType" minOccurs="0"
maxOccurs="unbo unded" />
</xs:choice>
</xs:complexType>
<xs:complexTy pe name="AppFuncti onType">
<xs:complexCont ent>
<xs:extension base="UIElement Type">
<xs:choice maxOccurs="unbo unded">
<xs:element name="MethodSet " type="MethodSet Type"
maxOccurs="unbo unded" />
</xs:choice>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
<xs:complexTy pe name="MethodSet Type">
<xs:complexCont ent>
<xs:extension base="UIElement Type">
<xs:choice maxOccurs="unbo unded">
<xs:element name="MethodCal l" type="MethodCal lType" minOccurs="0"
maxOccurs="unbo unded" />
</xs:choice>
<xs:attribute name="name" type="xs:string " use="required" />
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
This definition is allowing me mutiple UseTemplate nodes directly under
AppFunctions but once I add a MethodSet node under AppFunctions, it
does not allow any UseTemplates anymore.
Thanx in advance,
Amol.