RELAX NG by Eric van der Vlist will be published by O'Reilly & Associates (ISBN: 0596004214)

You are welcome to use our annotation system to give your feedback.


Enumerations

An enumeration is a choice between several values. Enumerations are thus written in RELAX NG by combining the choice pattern with the value pattern. In our library, a good candidate for an enumeration is the available attribute, which could be defined as:

    <attribute name="available">
     <choice>
      <value>available</value>
      <value>checked out</value>
      <value>on hold</value>
     </choice>
    </attribute>

or:

   attribute available {"available"|"checked out"|"on hold"}

This definition will validate values such as "available", "checked out" and "on hold". It will also validate values such as " available ", "checked out " or even " on hold " with multiple spaces, tabs or carriage returns between "on" and "hold" or "checked" and "out". We will see the reason for this behavior--and how to change it if needed--in the next section.


You are welcome to use our annotation system to give your feedback.
[Annotations for this page]
All text is copyright Eric van der Vlist, Dyomedea. During development, I give permission for non-commercial copying for educational and review purposes. After publication, all text will be released under the Free Software Foundation GFDL.