Undefined elements XSD definition

O

oziris

hi !

I would like to write a schema for this kind of XML document

<request>
<params>
<param1>foo</param1>
<pouet>foo</pouet>
<truc>bidule</truc>
</params>
<body>
.....
</body>
</request>

The number and the name of the params are undefined. Another valid XML
document could be

<request>
<params>
<azerty>foo</azerty>
<qwerty>foo</qwerty>
<name>oziris</name>
</params>
<body>
.....
</body>
</request>

Is there a XSD mean to specify that?
Using <xs:any> was my first idea but I wonder if there is better
answer.

Thanks a lot.

-o--
 
M

Martin Honnen

oziris wrote:

<params>
<param1>foo</param1>
<pouet>foo</pouet>
<truc>bidule</truc>
</params>
The number and the name of the params are undefined.
Is there a XSD mean to specify that?
Using <xs:any> was my first idea but I wonder if there is better
answer.

You would need xs:any if you don't know the element names.
But of course you could avoid that with e.g.
<params>
<param name="param1" value="foo"</param>
</params>
and then define that element param as having two attributes name and
value as needed.
 
H

Henry S. Thompson

oziris said:
The number and the name of the params are undefined.

Is there a XSD mean to specify that?
Using <xs:any> was my first idea but I wonder if there is better
answer.

That's precisely what xs:any is for.

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