Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > newbie xml xsd modelling problem

Thread Tools

newbie xml xsd modelling problem

Tis Veugen
Posts: n/a
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:complexType name="ct1">
<xsd:attribute name="type" type="st1" fixed="v1"/>
<xsd:element name="str" type="string"/>
<xsd:element name="str" type="string"/>
<xsd:attribute name="type" type="st1"/>

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

The xml-file:

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

<str> my data </str>

<my_ct type="v2">

<my_ct type="v3">

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

Tis Veugen

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert XML to XSD? or DTD to XSD? Matt XML 3 09-11-2008 12:40 PM
Overriding XSD locations when validating an xml document with multiple xsd references Java 0 08-25-2006 11:22 AM
Validation of XSD (XML Schema) against XSD Rushi XML 1 12-09-2005 08:12 AM
XML + XSD: Is it possible to get all errors against the XSD? Markus Java 1 11-22-2005 02:53 PM
XML schema - Make xsd include another xsd stiank81 XML 4 06-26-2005 05:11 PM