by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Name

pattern|pattern — choice pattern

Synopsis

pattern ("|" 
pattern)+

Restrictions

pattern

May be included in

(pattern), attribute, datatypeName param exceptPattern, element, list, mixed, pattern&pattern, pattern*, pattern+, pattern,pattern, pattern?, pattern|pattern

XML syntax equivalent

choice

Description

The choice pattern defines a choice between different patterns; it matches a node if, and only if, at least one of its subpatterns matches this node.

Any number of patterns may be combined using the | operator when using this construct; however, different operators (,| &) can't be mixed at the same level.

Example

element name {
 text|(
  element first{text},
  element middle{text}?,
  element last{text}
 )}
 
 attribute available {"true"|"false"|"who knows?"}

This text is released under the Free Software Foundation GFDL.