Name

empty — Empty content

Synopsis

“empty”

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

empty

Description

The empty pattern is used to define empty pattern nodesets—for example elements without child elements, text, or attributes. Note that it is mandatory to use this pattern in such cases (element foo{ } isn’t forbidden) and that there is no such thing as an empty attribute (an attribute such as foo=“” is considered to have a value of the empty string rather than being empty—having no value).

Example

element foo {
 element out {empty} &
 (
  element in1 {empty},
  element in2 {empty}
 )
}

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.