XML schema question

R

Robert Harakaly

Hi
I have a problem to express my needs in the XML schema. I need to
validate an XML configuration file, where I have following XML tags:

<param name="some_name" value="some_value"/>

But I need to make a check between the name attribute value (some_name)
and the type(value) of the value attribute. I need to find a way how to
define the type of the "value" attribute for each value of the "name"
attribute.

In other words: I need to express that the attribute "name" can have a
value from a list of enumerated values ("name1", "name2", ...) but also
that each name form this list has associated its own type of the value
attribute.

In XML it would be:
....
....
<param name="name1" value="99"/>
<!-- value for "name1" is an integer from 0 to 100 -->
<param name="name2" value="String"/>
<!-- value for "name2" is a string -->
....
....


!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The:
<param name="name1" value="101"/>
or
<param name="name1" value="Some_name"/>

should generate a validation error.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I'll appreciate any direction where to look, URL, partial solution from
which I can learn, etc, to help me to solve this problem.

Thank you

Robert Harakaly
 

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

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top