[XML Schema] Key-values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kelvSYC

    #1

    [XML Schema] Key-values

    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.
Working...