|
Home > Archive > MS SQL XML > January 2006 > xml schema validation error while creating schema collection.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
xml schema validation error while creating schema collection.
|
|
| sqldatarchitect 2006-01-11, 8:24 pm |
| I am trying to create a schema collection. I get an error.
XML Validation: XML instances of the content model of type or model group
'xs-nun(/listitem/complexType())' can be validated in multiple ways and are
not supported.
Please help ! Thank you.
Xml Schema is as follows.
********************
********************
****************
CREATE XML SCHEMA COLLECTION XmlSchNmhg
AS
'<?xml version = "1.0" encoding = "utf-8"?>
<!--Generated by Turbo XML 2.3.1.100. Conforms to w3c
http://www.w3.org/2001/XMLSchema-->
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
<!-- ====================
====================
====================
=========
-->
<!-- Basic Document Elements
-->
<!-- ====================
====================
====================
=========
-->
<xsd:element name = "manual">
<!-- ====================
====================
====================
=========
-->
<!-- External Entity References
-->
<!-- ====================
====================
====================
=========
-->
<xsd:complexType>
<xsd:attribute name = "id" use = "required" type = "xsd:ID"/>
<xsd:attribute name = "language" use = "required">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "CS"/>
<xsd:enumeration value = "DA"/>
<xsd:enumeration value = "DE"/>
<xsd:enumeration value = "EL"/>
<xsd:enumeration value = "EN"/>
<xsd:enumeration value = "ES"/>
<xsd:enumeration value = "ET"/>
<xsd:enumeration value = "FI"/>
<xsd:enumeration value = "FR"/>
<xsd:enumeration value = "HR"/>
<xsd:enumeration value = "HU"/>
<xsd:enumeration value = "IS"/>
<xsd:enumeration value = "IT"/>
<xsd:enumeration value = "LT"/>
<xsd:enumeration value = "LV"/>
<xsd:enumeration value = "NL"/>
<xsd:enumeration value = "NO"/>
<xsd:enumeration value = "PL"/>
<xsd:enumeration value = "PT"/>
<xsd:enumeration value = "RO"/>
<xsd:enumeration value = "RU"/>
<xsd:enumeration value = "SK"/>
<xsd:enumeration value = "SL"/>
<xsd:enumeration value = "SV"/>
<xsd:enumeration value = "TR"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "region" use = "required">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "US"/>
<xsd:enumeration value = "UK"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "brand" use = "required">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "Hyster"/>
<xsd:enumeration value = "Yale"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name = "listitem">
<xsd:complexType>
<xsd:choice minOccurs= "0" maxOccurs = "unbounded" >
<xsd:sequence>
<xsd:choice minOccurs = "0" maxOccurs = "unbounded">
<xsd:element ref = "warning"/>
<xsd:element ref = "warningref"/>
</xsd:choice>
<xsd:choice minOccurs = "0" maxOccurs = "unbounded">
<xsd:element ref = "note" minOccurs = "0" maxOccurs = "unbounded"/>
</xsd:choice>
</xsd:sequence>
<xsd:choice>
<xsd:element ref = "olist"/>
</xsd:choice>
</xsd:choice>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
<xsd:attribute name = "charfill" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "olist">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref = "listitem" maxOccurs = "unbounded" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
<xsd:attribute name = "type" default = "number">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "number"/>
<xsd:enumeration value = "loweralpha"/>
<xsd:enumeration value = "upperalpha"/>
<xsd:enumeration value = "lowerroman"/>
<xsd:enumeration value = "upperroman"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "start" type = "xsd:NMTOKEN"/>
<xsd:attribute name = "squeeze" default = "no">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "yes"/>
<xsd:enumeration value = "no"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name = "step1">
<xsd:complexType>
<xsd:sequence>
<xsd:sequence maxOccurs = "unbounded" minOccurs="0">
<xsd:choice minOccurs = "0" maxOccurs = "unbounded">
<xsd:element ref = "warning"/>
<xsd:element ref = "warningref"/>
</xsd:choice>
<xsd:element ref = "note" minOccurs = "0" maxOccurs = "unbounded"/>
<xsd:choice>
<xsd:element ref = "olist"/>
</xsd:choice>
</xsd:sequence>
</xsd:sequence>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "warning">
<xsd:complexType>
<xsd:sequence maxOccurs = "unbounded" minOccurs="0">
<xsd:choice maxOccurs = "unbounded" minOccurs="0">
<xsd:element ref = "para"/>
<xsd:element ref = "olist"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "warningref">
<xsd:complexType>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "warningid" use = "required" type = "xsd:string"/>
<xsd:attribute name = "label" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "note">
<xsd:complexType>
<xsd:choice maxOccurs = "unbounded" minOccurs="0">
<xsd:element ref = "para"/>
<xsd:element ref = "olist"/>
</xsd:choice>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "para"><!-- squeeze is used to alter pre- and postspace
to the element -->
<xsd:complexType mixed = "true">
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>'
| |
| Kent Tegels 2006-01-11, 8:24 pm |
| Hello sqldatarchitect,
You have a few CHOICEs without a minOccurs="0". That's one of the things
that SQL Server 2005 doesn't like in schemas. Simply fixing those doesn't
completely fix the schema though, but maybe this link [0] will give you some
ideas until I can give this more thought.
[0]: http://msdn2.microsoft.com/en-us/library/ms190665.aspx
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
| |
| sqldatarchitect 2006-01-12, 9:23 am |
| Thanks Kent,
Here is a simplified schema with minOccurs = "0",
still getting the same error
<?xml version = "1.0" encoding = "utf-8"?>
<!--Generated by Turbo XML 2.3.1.100. Conforms to w3c
http://www.w3.org/2001/XMLSchema-->
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
<!-- ====================
====================
====================
=========
-->
<!-- Basic Document Elements
-->
<!-- ====================
====================
====================
=========
-->
<xsd:element name = "manual">
<!-- ====================
====================
====================
=========
-->
<!-- External Entity References
-->
<!-- ====================
====================
====================
=========
-->
<xsd:complexType>
<xsd:attribute name = "id" use = "required" type = "xsd:ID"/>
<xsd:attribute name = "language" use = "required">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "CS"/>
<xsd:enumeration value = "DA"/>
<xsd:enumeration value = "DE"/>
<xsd:enumeration value = "EL"/>
<xsd:enumeration value = "EN"/>
<xsd:enumeration value = "ES"/>
<xsd:enumeration value = "ET"/>
<xsd:enumeration value = "FI"/>
<xsd:enumeration value = "FR"/>
<xsd:enumeration value = "HR"/>
<xsd:enumeration value = "HU"/>
<xsd:enumeration value = "IS"/>
<xsd:enumeration value = "IT"/>
<xsd:enumeration value = "LT"/>
<xsd:enumeration value = "LV"/>
<xsd:enumeration value = "NL"/>
<xsd:enumeration value = "NO"/>
<xsd:enumeration value = "PL"/>
<xsd:enumeration value = "PT"/>
<xsd:enumeration value = "RO"/>
<xsd:enumeration value = "RU"/>
<xsd:enumeration value = "SK"/>
<xsd:enumeration value = "SL"/>
<xsd:enumeration value = "SV"/>
<xsd:enumeration value = "TR"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "region" use = "required">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "US"/>
<xsd:enumeration value = "UK"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "brand" use = "required">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "Hyster"/>
<xsd:enumeration value = "Yale"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name = "listitem">
<xsd:complexType>
<xsd:choice minOccurs= "0" maxOccurs = "unbounded">
<xsd:sequence>
<xsd:choice minOccurs = "0" maxOccurs = "unbounded">
<xsd:element ref = "warning"/>
<xsd:element ref = "warningref"/>
</xsd:choice>
<xsd:choice minOccurs = "0" maxOccurs = "unbounded">
<xsd:element ref = "note"/>
</xsd:choice>
</xsd:sequence>
<xsd:sequence>
<xsd:choice minOccurs = "0" maxOccurs = "unbounded">
<xsd:element ref = "olist"/>
</xsd:choice>
</xsd:sequence>
</xsd:choice>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
<xsd:attribute name = "charfill" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "olist">
<xsd:complexType><!--
<xsd:sequence>
<xsd:element ref = "listitem"/>
</xsd:sequence>-->
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
<xsd:attribute name = "type" default = "number">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "number"/>
<xsd:enumeration value = "loweralpha"/>
<xsd:enumeration value = "upperalpha"/>
<xsd:enumeration value = "lowerroman"/>
<xsd:enumeration value = "upperroman"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "start" type = "xsd:NMTOKEN"/>
<xsd:attribute name = "squeeze" default = "no">
<xsd:simpleType>
<xsd:restriction base = "xsd:NMTOKEN">
<xsd:enumeration value = "yes"/>
<xsd:enumeration value = "no"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name = "warning">
<xsd:complexType>
<xsd:sequence>
<xsd:choice maxOccurs = "unbounded" minOccurs="0">
<xsd:element ref = "para"/>
<xsd:element ref = "olist"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "warningref">
<xsd:complexType>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "warningid" use = "required" type = "xsd:string"/>
<xsd:attribute name = "label" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "note">
<xsd:complexType>
<xsd:choice maxOccurs = "unbounded" minOccurs="0">
<xsd:element ref = "para"/>
<xsd:element ref = "olist"/>
</xsd:choice>
<xsd:attribute name = "id" type = "xsd:ID"/>
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name = "para">
<xsd:complexType mixed = "true">
<xsd:attribute name = "effectivity" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
"Kent Tegels" wrote:
> Hello sqldatarchitect,
>
> You have a few CHOICEs without a minOccurs="0". That's one of the things
> that SQL Server 2005 doesn't like in schemas. Simply fixing those doesn't
> completely fix the schema though, but maybe this link [0] will give you some
> ideas until I can give this more thought.
>
> [0]: http://msdn2.microsoft.com/en-us/library/ms190665.aspx
>
>
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>
>
| |
| Brandon Berg [MSFT] 2006-01-17, 8:24 pm |
| "sqldatarchitect" < sqldatarchitect@disc
ussions.microsoft.com> wrote in
message news:41799186-DCF5-43AB-B4EA- A7B82EE90EA5@microso
ft.com...
> Thanks Kent,
> Here is a simplified schema with minOccurs = "0",
> still getting the same error
>
> <xsd:choice minOccurs= "0" maxOccurs = "unbounded" >
> <xsd:sequence>
> <xsd:choice minOccurs = "0" maxOccurs = "unbounded">
> <xsd:element ref = "warning"/>
> <xsd:element ref = "warningref"/>
> </xsd:choice>
> <xsd:choice minOccurs = "0" maxOccurs = "unbounded">
> <xsd:element ref = "note" minOccurs = "0" maxOccurs = "unbounded"/>
> </xsd:choice>
> </xsd:sequence>
> <xsd:element ref = "olist"/>
> </xsd:choice>
Sorry about the late reply. Unless I'm reading this wrong, your content
model for filelist's type is just a complicated way of saying that any
number of any of those four elements are allowed in any order. If that's
what you want, just use a choice with those four elements and minOccurs="0"
and maxOccurs="unbounded" on the choice itself (but no minOccurs/maxOccurs
on the elements). If not, let me know what you do want, and I'll see if I
can find a better way of expressing it.
We are working on broadening the range of ambiguous content models which we
accept for SP1, but I think this is an issue best addressed by improving the
schema design.
--
Brandon Berg
Software Design Engineer
Microsoft SQL Server
|
|
|
|
|