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


Name

(pattern) — Container

Synopsis

"(" 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

None

Description

The (pattern) container is useful when grouping together patterns combined using , (ordered group), | (choice), or & (interleave). This container is treated itself as a pattern and may be combined with other patterns or quantified using qualifiers.

The operator (, | &) used within the (pattern) container defines how the subpatterns are combined, and different operators can't be mixed at the same level.

Even when such a container isn't required, it is often used to improve the readability of a schema.

Example

 element name {
 text|(
  element first{text},
  element middle{text}?,
  element last{text}
 )}
 
element foo {
 element out {empty} &
 (
  element in1 {empty},
  element in2 {empty}
 )
}

This text is released under the Free Software Foundation GFDL.