Name

mixed — Pattern for mixed content models

Synopsis

“mixed” “{” 
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

mixed

Description

The mixed pattern is a shortcut for interleave with an embedded text pattern. It describes unordered content models in which a text node may be included before and after each element. Note that RELAX NG doesn’t allow adding constraints to these text nodes.

Restrictions

The limitations of interleave apply here:

  • The mixed pattern can’t be used within a list.

  • Elements within a mixed pattern can’t have overlapping name classes.

  • There must no other text pattern in each set of patterns combined by mixed.

Example

element title {
 mixed {
  attribute xml:lang {text}&
  element a {attribute href {text}, text} *
 }
}
is equivalent to:
element title {
 ( text & (
  attribute xml:lang {text}&
  element a {attribute href {text}, text} *
 )
}
which itself is equivalent to:
element title {
  text & 
  attribute xml:lang {text}&
  element a {attribute href {text}, text} *
}

Get RELAX NG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.