473,387 Members | 1,353 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,387 software developers and data experts.

XML Schema Problem

Folks,

I need to create a schema for legacy xml data where the
sequence of child elements is part of the semantics.
The problem is that I have no succeeded in creating a
schema that allows different child elements to apear in
arbitrary order. This was possible and simple with XDR,
but I have not found a way to describe this using X-
Schema.

The two following documents should be valid

<root>
<A/>
<A/>
<A/>
<B/>
<A/>
<B/>
</root>

<root>
<C/>
<A/>
<C/>
<B/>
<A/>
<A/>
</root>

Nov 12 '05 #1
4 1106
xsd:all ?

"Piet" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
Folks,

I need to create a schema for legacy xml data where the
sequence of child elements is part of the semantics.
The problem is that I have no succeeded in creating a
schema that allows different child elements to apear in
arbitrary order. This was possible and simple with XDR,
but I have not found a way to describe this using X-
Schema.

The two following documents should be valid

<root>
<A/>
<A/>
<A/>
<B/>
<A/>
<B/>
</root>

<root>
<C/>
<A/>
<C/>
<B/>
<A/>
<A/>
</root>

Nov 12 '05 #2
-----Original Message-----
xsd:all ?

"Piet" <an*******@discussions.microsoft.com> wrote in messagenews:06****************************@phx.gbl...
Folks,

I need to create a schema for legacy xml data where the
sequence of child elements is part of the semantics.
The problem is that I have no succeeded in creating a
schema that allows different child elements to apear in
arbitrary order. This was possible and simple with XDR,
but I have not found a way to describe this using X-
Schema.

The two following documents should be valid

<root>
<A/>
<A/>
<A/>
<B/>
<A/>
<B/>
</root>

<root>
<C/>
<A/>
<C/>
<B/>
<A/>
<A/>
</root>

.


Thanks, but I am afraid it doesn't do it. The problem is
that the maxOccurs of each element in a "all" group is
constrained to 1.
Nov 12 '05 #3
Wrap it in a repeating sequence?

"Piet" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
-----Original Message-----
xsd:all ?

"Piet" <an*******@discussions.microsoft.com> wrote in

message
news:06****************************@phx.gbl...
Folks,

I need to create a schema for legacy xml data where the
sequence of child elements is part of the semantics.
The problem is that I have no succeeded in creating a
schema that allows different child elements to apear in
arbitrary order. This was possible and simple with XDR,
but I have not found a way to describe this using X-
Schema.

The two following documents should be valid

<root>
<A/>
<A/>
<A/>
<B/>
<A/>
<B/>
</root>

<root>
<C/>
<A/>
<C/>
<B/>
<A/>
<A/>
</root>

.


Thanks, but I am afraid it doesn't do it. The problem is
that the maxOccurs of each element in a "all" group is
constrained to 1.

Nov 12 '05 #4
Piet wrote:
I need to create a schema for legacy xml data where the
sequence of child elements is part of the semantics.
The problem is that I have no succeeded in creating a
schema that allows different child elements to apear in
arbitrary order.


Use xs:choice for that.

<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="A"/>
<xs:element name="B"/>
<xs:element name="C"/>
</xs:choice>

--
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
Nov 12 '05 #5

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

Similar topics

0
by: C. M. Sperberg-McQueen | last post by:
wooks (wookiz@hotmail.com) wrote: > <?xml version='1.0'?> > <userlogin xmlns="urn:faster:userlogin" > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <login>mick</login> > ...
1
by: Gregg Williams | last post by:
Hi--I am having a problem designing a schema to fit my XML data, and I'm hoping that someone can help. Essentially, I have a schema in mind and two target vocabularies for it, where one vocabulary...
4
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could...
5
by: Zombie | last post by:
Hi, Can I have 2 namespaces in the same XML schema? In the schema, I wish to declare elements such that some of them belong to one namespace and others belong to a second namespace. Is this...
1
by: Marcello Villani | last post by:
Hi All, I have this problem: my customer sent me a RDF file with its own schema. I absolutely need to convert that RDF schema in XML schema. Does anybody knows if this operation is possible? Can...
2
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema"...
4
by: Iain A. Mcleod | last post by:
Hi I'm stuck with the following schema validation problem in VS.NET 2003: I have two types of xml document and related schema: project and projectCollection. A projectcollection is just a set...
2
by: Ali | last post by:
I am having problem compiling schema contained in WSDL file when analyzing schema types contained in it (for example http://www.ebout.net/net/GoogleSearch.wsdl). Following code demonstrates my...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
2
by: yannick.beot | last post by:
Hi, I have a problem with nested namespace in a schema. I defined a schema A. A is importing a schema B with the namespace nsB and a schema C with the namespace nsC. But both B and C are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
0
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...

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.