XML schema question

Discussion in 'XML' started by Robert Harakaly, Oct 27, 2004.

  1. 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
     
    Robert Harakaly, Oct 27, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,541
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    949
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    463
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,265
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,870
Loading...

Share This Page