Priscilla said:
Hi,
You almost had it. You need an extra xs:simpleType element in there.
Also, you don't want to use itemType - it's an either/or thing - either
you specify the itemType attribute OR a simpleType child.
<xs:element name="ABNFRULESET" type="xs:token" maxOccurs="1">
<xs:simpleType>
<xs:list>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs
attern value="\p{IsBasicLatin}*"/>
</xs:restriction>
</xs:simpleType>
</xs:list>
</xs:simpleType>
</xs:element>
Some more examples of list types are at:
http://www.datypic.com/books/defxmlschema/chapter11.html
Hope that helps,
Priscilla
----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
XQuery
http://www.datypic.com
----------------------------------
Thanks Priscilla Actually I figured this out before I saw your post but
now I have a bigger problem
I have now fully composed my xsd which is as follows
================================================================
<?xml version="1.0"?>
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
targetNamespace="
http://www.w3schools.com"
xmlns="
http://www.w3schools.com" elementFormDefault="qualified">
<xs:element name="PROTOHEADERENTRY">
<xs:complexType>
<xs:sequence>
<xs:element name="ABNFGRAMMER" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="ABNFRULESET" maxOccurs="1">
<xs:simpleType>
<xs:list>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs
attern value="\p{IsBasicLatin}*"/>
</xs:restriction>
</xs:simpleType>
</xs:list>
</xs:simpleType>
</xs:element>
<xs:element name="ABNFEXCEPTION" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="RULENAME" type="xs:token"/>
<xs:attribute>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="MANDATORY"/>
<xs:enumeration value="IGNORESEQ"/>
<xs:enumeration value="IGNORECASE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="NAME" type="xs:token"/>
<xs:attribute name="HEADERSEQNUM" type="positiveInteger"/>
</xs:complexType>
</xs:element>
<xs:element name="ABNFBASIC">
<xs:complexType>
<xs:sequence>
<xs:element name="RULESTRING" type="xs:string" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="ABNFBASICNAME" type="NMTOKEN"/>
</xs:complexType>
</xs:element>
<xs:element name="ABNFRULE">
<xs:complexType>
<xs:sequence>
<xs:element name="RULESTRING" type="xs:string" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="RULENAME" type="NMTOKEN"/>
</xs:complexType>
</xs:element>
<xs:element name="PROTOHEADER">
<xs:complexType>
<xs:attribute name="PROTOHEADERNAME" type="xs:token"/>
<xs:attribute name="ENTRYSEQNUM" type="xs
ositiveInteger"/>
</xs:complexType>
</xs:element>
<xs:element name="PROTODEF">
<xs:complexType>
<xs:sequence>
<xs:element name="PROTOTABLE">
<xs:complexType>
<xs:sequence>
<xs:element ref="PROTOHEADER" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="PROTOHEADERENTRY" maxOccurs="unbounded"/>
<xs:element ref="ABNFRULE" maxOccurs="unbounded"/>
<xs:element ref="ABNFBASIC" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="PROTOCOLNAME" type="xs:token"/>
<xs:attribute name="PROJECTNAME" type="xs:string"/>
</xs:complexType>
<xs:key name="KEYHEADERNUM">
<xs:selector xpath="PROTOHEADERENTRY"/>
<xs:field xpath="HEADERSEQNUM"/>
</xs:key>
<xs:keyref name="KEYENTRYNUM">
<xs:selector xpath="PROTOHEADER"/>
<xs:field xpath="ENTRYSEQNUM"/>
</xs:keyref>
</xs:element>
</xs:schema>
===============================================================
And now when I give it to the validator I get the following
=============================================================
For attribute '???', either the name or the ref attribute must be
present, but not both.
If ref is present, all of 'simpleType', 'form', 'type', and 'use' must
be absent.
The referring attribute must be present.
=============================================================
This is the web based validator at the w3school site and it doesnt show
the line numbers so I cant figure out where exactly is the problem.
Ant help will be appreciated
Also can someone point me to a good freeware which can validate xsd
thanks
Shyam