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

XMLSchema syntax problem

AL
Hi all,

I have an XML document like this:
<root>
<node>A</node>
<node>B</node>
<node>C</node>
</root>

it's very important validate the following xml doc:
<root> <root>
<node>A</node> <node>A</node>
<node>B</node> </root>
</root>

and don't validate a document like this:
<root>
<node>B</node>
<node>A</node>
</root>

I'd like to validate this document using XML Schema. Is it possible?
Thanks!!

Nov 7 '05 #1
4 1380
AL wrote:
Hi all,

I have an XML document like this:
<root>
<node>A</node>
<node>B</node>
<node>C</node>
</root>

it's very important validate the following xml doc:
<root> <root>
<node>A</node> <node>A</node>
<node>B</node> </root>
</root>

and don't validate a document like this:
<root>
<node>B</node>
<node>A</node>
</root>

I'd like to validate this document using XML Schema. Is it possible?
Thanks!!


This is not valid using XSchema, but there
are some other schema tecnologies,

i think schematron could do the job for you,
or you have to wait for the next xschema version.

http://www.schematron.com/
Nov 7 '05 #2
AL
I was afraid of it :-(
Anyway, thanks a lot!!
This is not valid using XSchema, but there
are some other schema tecnologies,

i think schematron could do the job for you,
or you have to wait for the next xschema version.

http://www.schematron.com/


Nov 7 '05 #3
Tjerk wrote:
This is not valid using XSchema, but there


I meant off course:

This is not possible with XSchema...

But that just my intuition telling me that.
Maybe there is some clever way you can create a schema
for you kind of documents,

but i dont see how
Nov 7 '05 #4
"AL" <gi**************@yahoo.it> writes:
Hi all,

I have an XML document like this:
<root>
<node>A</node>
<node>B</node>
<node>C</node>
</root>

it's very important validate the following xml doc:
<root> <root>
<node>A</node> <node>A</node>
<node>B</node> </root>
</root>

and don't validate a document like this:
<root>
<node>B</node>
<node>A</node>
</root>


I'm not sure I understand your requirement. Do you mean that that
text content of <node> elements must appear in lexicographic order
(sorted)?

You certainly can't express that constraint with W3C XML Schema or
RelaxNG. Probably can with Schematron.

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]
Nov 8 '05 #5

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

Similar topics

0
by: BODIN | last post by:
I have an XML document, which is actually physically stored in 2 separated files. doc1.xml and doc2.xml I NEED a WAY FOR THIS SIMPLE NEED : XML file splitted into two physical files, and use...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
4
by: Stefan Rotter | last post by:
Hi, I'm trying to load a schema into an XmlSchema object with the Read and Compile methods. I use Read with a ValidationEventHandler. No errors occurs but when I look at the XmlSchema properties...
2
by: Alex Shirshov | last post by:
Hello, All! It seems the bug (http://groups.google.com/groups?hl=ru&lr=&ie=UTF-8&threadm=a53b01c28a00%242 08bc860%2439ef2ecf%40TKMSFTNGXA08&rnum=8&prev=/groups%3Fq%3DschemaLocation%2...
1
by: Rumen Traykov via .NET 247 | last post by:
Have somebody had already the problem of having to write more than one XmlSchema, where some of these schemas have imports to others and respectively derived types? The imports cannot be resolved...
1
by: Maansi Sanghi | last post by:
Hello, I am trying to write an xsd file using .NET System.Xml.Sxhema Class Library. (1) I get an error while writitng if the XSD has a taregetnamespace. (II) for any xsd with no...
2
by: Martin Madreza | last post by:
Hi, I have a problem with reading an XmlSchema with Frameowk 2.0 and an own DataType. I found no example (searching two days). What I do is: DataSet dataSet = new DataSet();...
3
by: JMD | last post by:
A set of xsd files has been working fine for us at this site, but now it gives *intermittent* errors for someone at a different cite (who is consuming the code we are producing). Most of the time...
1
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that...
0
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned...
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:
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?
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
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
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...

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.