Restrictions in XSD

T

TIANA

Hi guys
Unfortunately I’m a newbee to xml and xsd Schemes. I’m
having the following xml file:

<config >
<section name="A">
<entry key="k1" val="aaa" />
<!-- (range for 'val' = aaa|bbb|ccc-->
<entry key="k2" val ="true" />
<!-- (range for 'val' = true|false) -->
</section>
<section name="B">
<entry key="k3" val ="3" />
<!-- (range for 'val' = 1...10) -->
</section>
</ config >


Now, I'd like to create an xsd file for it.
I have no idea how to define the range for the attribute 'val'
depending on the values for the 'name' - attribute of the element
'ection' and the 'key' attribute in 'entry'
I think I have to use xsd:restriction /enumeration
But how do I express those dependencies????

I hope, I did not confuse you guys too much.
I'd be glad for any kind of help or hint how to start.
TIA
 

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
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top