On 5 Apr, 08:49, "puffy" <puffy.ch...@gm ail.comwrote:
Hi, Everyone!
I'd need a little help. I understand this is not valid, but is there
an (easy) way to make it valid?
<xs:complexTy pe name="control_T ype">
<xs:sequence>
<xs:element name="id" type="id_Type"/>
<xs:element name="position" type="pos_Type"/>
<xs:element name="name" type="xs:string "/>
<xs:choice>
<xs:sequence< !-- static -->
<xs:element name="type" type="xs:positi veInteger" fixed="28251"/>
<xs:element name="h_align" type="h_align_T ype"/>
<xs:element name="v_align" type="v_align_T ype"/>
<xs:element name="text" type="MultiLang Text_Type"/>
</xs:sequence>
<xs:sequence< !-- check -->
<xs:element name="type" type="xs:positi veInteger" fixed="28252"/>
<xs:element name="is_checke d" type="xs:boolea n"/>
<xs:element name="text" type="MultiLang Text_Type"/>
</xs:sequence>
<!-- other control types -->
</xs:choice>
</xs:sequence>
</xs:complexType>
Thank you very much!
Chris
I don't think schema currently offers any great solutions to this.
One option might be to do something like:
<xs:complexTy pe name="control_T ype">
<xs:sequence>
<xs:element name="id" type="id_Type"/>
<xs:element name="position" type="pos_Type"/>
<xs:element name="name" type="xs:string "/>
<xs:choice>
<xs:sequence< !-- static -->
<xs:element name="type28251 "
type="empty"/>
<xs:element name="h_align"
type="h_align_T ype"/>
<xs:element name="v_align"
type="v_align_T ype"/>
<xs:element name="text"
type="MultiLang Text_Type"/>
</xs:sequence>
<xs:sequence< !-- check -->
<xs:element name="type28252 "
type="empty"/>
<xs:element name="is_checke d"
type="xs:boolea n"/>
<xs:element name="text"
type="MultiLang Text_Type"/>
</xs:sequence>
<!-- other control types -->
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexTy pe name="empty"/>
Even I don't think that's pretty though!
Another option might be to use xsi:type in some way, and define a
number of restrictions or extensions for the various types.
HTH,
Pete.
--
=============== =============== ===============
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/ http://www.codalogic.com/lmx/
=============== =============== ===============