473,569 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Schema: problem with order of fields in extended element

Hi,

I've got a following problem with the order of fields in extended
element: let's assume, that I have a complex type with a few fields,
that I want to extend with additional field. In extended type I would
like to have the possibility of entering fields (both from base and
extended type) in any order, but during validation XMLSPY shows me an
error. What am I doing wrong?

Sample schema definition:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<xs:element name="tmp">
<xs:complexType >
<xs:complexCont ent>
<xs:extension base="tmp2">
<xs:all minOccurs="0">
<xs:element name="c" minOccurs="0"/>
</xs:all>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
</xs:element>
<xs:complexTy pe name="tmp2">
<xs:all>
<xs:element name="a" minOccurs="0"/>
<xs:element name="b" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:schema>

and the sample incorrect data file:
<?xml version="1.0" encoding="UTF-8"?>
<tmp xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "tmp.xsd">
<a>Text</a>
<c>Text</c>
<b>Text</b>
</tmp>

Regards
Maciek
Jul 20 '05 #1
0 1196

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

Similar topics

0
7060
by: Gowhera Hussain | last post by:
Use This for Learning Only .... Do Not Try To Act Smart HACKING WITH JAVASCRIPT Dr_aMado Sun, 11 Apr 2004 16:40:13 UTC This tutorial is an overview of how javascript can be used to bypass simple/advanced html forms and how it can be used to override cookie/session
0
5055
by: Antony | last post by:
Hi there, firstly thank you for thinking about this problem of mine. This is a long message because I want to put all the facts (the XML and the schema) to try to get a solution from you helpful readers of the newsgroup. Here is my problem. I have defined the following XML schema. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">...
1
1368
by: c_capatana | last post by:
Hello! I have a problem with a schema. I don't know what i can do in a simple way. I have a message in a file text. I describe its structure using xml schema. <xs:complexType name="MyMessageType"> <xs:complexContent> <xs:extension base="sg:FieldsType"> <xs:sequence maxOccurs="unbounded">
2
1921
by: Zombie | last post by:
Hi all, I wish to create a namespace other than the default one. Let's say, the Schema looks like: ----------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:d="http://www.geodesy.org/dam" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"...
0
2173
by: Adam Retter | last post by:
Hi Guys, I have a need to create a html form based on my schema. I initially decided to do this using xql, have got some way but am finding this difficult (it may be as I am very new to xql). The html form needs to be dynamically generated from the schema as the schema may change in future. We need the forms to provide a UI for users to...
0
1566
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema' referenced in this document. The value for the 'base' attribute is invalid - 'xsd:string' is an invalid value for the 'base' attribute. An error...
3
2158
by: Chris Lieb | last post by:
I am new to XML Schema and am running into a bit of a snag. I have defined an XML-based scripting language for an updater program that I am working on. I would like to make a schema for this language since malformed XML documents break the updater. (I did not have time to add good error-handling code, so run-time errors can abound if the...
9
3003
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13> <binaryobject3></binaryobject3>
0
2798
by: icesign | last post by:
I know that the selector of these elements has a scope relative to the element being declared, but maybe there is a way to get beyond bounds of this scope or maybe just a way to extend base element? Here’s a working example: <xs:schema id="schema" targetNamespace="http://tempuri.org/schema.xsd" elementFormDefault="qualified" ...
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.