Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


newbie xml xsd modelling problem

From: "Tis Veugen" <Tis.Veugen@-------------.-->
To: NULL
Date: 4/3/2005 5:15:00 PM
Hi,
I have a modelling problem that I would like to make clear with these 
xml-file and xsd-file.

The xsd-file:

<xsd:simpleType name="st1">
  <xsd:restriction base="xsd:NMTOKEN">
    <xsd:enumeration value="v1"/>
    <xsd:enumeration value="v2"/>
    <xsd:enumeration value="v3"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="ct1">
  <xsd:choice>
    <xsd:sequence>
      <xsd:attribute name="type" type="st1" fixed="v1"/>
      <xsd:element name="str" type="string"/>
    </xsd:sequence>
    <xsd:sequence>
      <xsd:element name="str" type="string"/>
    </xsd:sequence>
    <xsd:sequence>
      <xsd:attribute name="type" type="st1"/>
    </xsd:sequence>
  </xsd:choice>
</xsd:complexType>

<xsd:element name="my_ct" type="ct1"/>

The xml-file:

<my_ct type="v1">
  <str> my other data </str>
</my_ct>

<my_ct>
  <str> my data </str>
</my_ct>

<my_ct type="v2">
</my_ct>

<my_ct type="v3">
</my_ct>

PROBLEM:
How to prevent that the following lines would be allowed, according to the 
3rd choice :
<my_ct type="v1">
</my_ct>
So, how should the xsd file look like?

Thanx,
Tis Veugen





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent