elementFormDefault - qualifed or unqualified - Restrictions (XmlSpy)

3 views
Skip to first unread message

dickster

unread,
Feb 16, 2006, 11:27:04 AM2/16/06
to XML Schema
I have a query about elementFormDefault

I have abbreviated the schemas - and hopefully have included all the
relevant information

I get the following error message (AltovaXmlSpy-when I click validate)
in Schema1.xsd:
"The content model of complex type '{no name}' is not a valid
restriction of the content model of complex type 'origo:TimePeriod'"

What does this mean - when I switch elementFormDefault to "qualified" I
DONT GET ANY ERROR MESSAGE:-|

---------------------------------------------------------------------------------------
Schema1.xsd
---------------------------------------------------------------------------------------
<xsd:schema
xmlns:origo="http://www.origoservices.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.origoservices.com"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">

<xsd:include schemaLocation="Schema2.xsd"/>

<xsd:complexType name="product">
<xsd:sequence>
.
.
.
<xsd:element name="policy_term" minOccurs="0">
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction base="origo:TimePeriod">
<xsd:sequence>
<xsd:element name="start_date" type="origo:Date"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType >

</xsd:schema>
---------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------
Schema2.xsd
---------------------------------------------------------------------------------------
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:origo="http://www.origoservices.com"
targetNamespace="http://www.origoservices.com"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
>
<xsd:complexType name="TimePeriod">
<xsd:sequence>
<xsd:element name="start_basis" type="origo:StartBasisType"
minOccurs="0"/>
<xsd:choice minOccurs="0">
<xsd:element name="start_date" type="origo:Date" minOccurs="0"/>
<xsd:element name="start_age" type="origo:Age" minOccurs="0"/>
</xsd:choice>
<xsd:choice minOccurs="0">
<xsd:element name="end_date" type="origo:Date" minOccurs="0"/>
<xsd:element name="end_age" type="origo:Age" minOccurs="0"/>
<xsd:element name="term" type="origo:Term" minOccurs="0"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>


<xsd:simpleType name="Date">
<xsd:restriction base="xsd:date"/>
</xsd:simpleType>


</xsd:schema>
---------------------------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages