Name

text — Pattern matching text nodes

Synopsis

“text”

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

text

Description

The text pattern matches zero or more text nodes. The fact that a text pattern matches more than one text node has no effect when it is used in ordered-content models (the data model used by RELAX NG for XML documents is similar to the data model of XPath 1.0, and two text nodes can’t be adjacent), but makes a difference when a text pattern is used in interleave. Adding a single text pattern in an interleave pattern allows any number of text nodes that can interleave before and after each element. Note that the mixed pattern is provided as a shortcut to define these content models.

Restrictions

No more than one text pattern can be included in an interleave pattern.

Example

element author {
 attribute id {text},



 element name {text},
 element born {text},
 element died {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.