XMLSchema syntax problem

A

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!!
 
T

Tjerk Wolterink

AL said:
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/
 
T

Tjerk Wolterink

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
 
H

Henry S. Thompson

AL said:
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: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 

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
474,001
Messages
2,570,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top