473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Query on elementFormDefault & Restrictions (using AltovaXmlSpy)

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: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>
Feb 16 '06 #1
3 1255


dickster wrote:
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:origo="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.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 16 '06 #2
dickster writes:
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
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Feb 20 '06 #3
Thanks for your reply Martin.

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

dickster

Feb 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

192
by: Kwan Ting | last post by:
The_Sage, I see you've gotten yourself a twin asking for program in comp.lang.c++ . http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=45cd1b289c71c33c&rnum=1 If you the oh so mighty...
0
by: Ethel Aardvark | last post by:
I am running a 9.0.1 database on a W2K server and have come across some strange behaviour with a SQL query. I have a query which runs in a PL/SQL cursor which has several PL/SQL variables used to...
3
by: Paul Hatcher | last post by:
Hi I have a transform going from XML to HTML, but I can't seem to get the XslTransform class to output &amp; as & even when using disable-output-escaping. I've tried writing the result to a...
17
by: Bruno | last post by:
I have a feature that is hosted on a different domain from the primary one in a frame, and need to retain values in a cookie. example: A web page at one.com contains a frame which has a page...
5
by: CindyRob | last post by:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET 2003, hotfixes 892202 and 823639. I create a proxy class using wsdl.exe, and in the serialized XML request, I see...
3
by: Rik | last post by:
Hello, first of all, my provider sucks, newsserver is down for the #nth time now, offcourse when I have an urgent question.... So this will be me first time using Google Groups, forgive me if...
8
by: shyam | last post by:
Hi All As per my understanding we use xs:key when we want to have a unique value for a element or attribute and keyref to refer to one of the unique values of that element or attribute. ...
1
by: Jimbo | last post by:
I have a query..if you look at the bottom of the where clause you'll see an "NOT IN" statement that is really hanging up the query..i'm trying to replace with a "NOT EXISTS" but it isnt appearing...
5
by: ofiras | last post by:
Hi everyone, As far as I know, you cannot connect directly to a SQL Server database from a web browser application because of the security restrictions. Is there any other way to connect to a SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.