Query on elementFormDefault & Restrictions (using AltovaXmlSpy)

dickster

Usenet Archive
Joined
Dec 8, 2005
Messages
3
Reaction score
0
I have a query surrounding 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:eek:rigo="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>
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
dickster said:
I have a query surrounding about elementFormDefault
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 :-|

You might want to use that then, if you want to define elements in a namespace then using elementFormDefault="qualified" is usually what you want and need to easily and consistently define your elements in the target namespace specified.

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

<xsd:element name="start_date" type="origo:Date"/>

If you use elementFormDefault="unqualified" then I think you need <xsd:element name="origo:start_date" to fit the definitions in the other included schema.
 

Henry S. Thompson

Usenet Archive
Joined
Jan 14, 2000
Messages
309
Reaction score
0
dickster said:
I have a query surrounding 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'"

The base complex type includes an element declaration which accepts EIIs whose expanded name is {http://www.origoservices.com, start_date}

Your restriction attempts to restrict that with an element declaration which accepts EIIs whose expanded name is {[none],start_date}.

The difference arises because only elementFormDefault is 'qualified' in the base schema document and 'unqualified' in yours, and that's what determines whether element declarations within complex type definitions acquire the target namespace of the enclosing schema document.

ht
 

dickster

Usenet Archive
Joined
Dec 8, 2005
Messages
3
Reaction score
0
Thanks for your reply Martin.

When I keep the elementFormDefault attribute consistent between each Schema it works fine.

dickster
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,245
Members
248,133
Latest member
DujonT

Latest Threads

Top