Enumeration or any string

From W3C Wiki
Jump to: navigation, search

Enumeration or any string (a co-constraint use case)

Make the type of one attribute (xsd:string vs. enumeration restricting NMTOKEN) depend on the presence or absence of a second attribute.

Cf. Alternative enumerations

source: Fabio Vitali


Other use cases: Co-constraint Use Cases

Description

   If no appropriate term appears in the dictionary, just use any string, and put
   no "dict" attribute.


    <keywords>
        <keyword dict="dict1" term="term1"/>
        <keyword              term="strangeTerm"/>
        ...
    </keywords>


Analysis

(Add your analysis here; see your name in pixels!)

Possible solutions

Relax NG

Schematron

Check clause

SchemaPath

Conditional Type