[XML Schema] Key-values

Discussion in 'XML' started by kelvSYC, Nov 24, 2003.

  1. kelvSYC

    kelvSYC Guest

    Is it possible in an XML schema to say that an attribute is valid only
    when it references another attribute in some other element (similar to
    IDREF but with strings)?

    For example, say I have an element a with a string attribute foo. Is
    it possible to define an element b with an attribute bar whose only
    permitted values are the values of foo?

    As a further example, suppose I have
    <a foo="123"/>
    <a foo="456"/>

    in one document and

    <a foo="abc"/>
    <a foo="def"/>

    in another

    How can I make bar only permit "123" and "456" in the first document
    and "abc" and "def" in the other?

    --
    I am only a mirage.
     
    kelvSYC, Nov 24, 2003
    #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.

Share This Page