Name

empty — Empty content

Synopsis

element empty
{
 (
 attribute ns { text }?,
 attribute datatypeLibrary { xsd:anyURI }?,
 attribute * - (rng:* | local:*) { text }*
 ),
 ( element * - rng:* { ... }* )
}

Class

pattern

May be included in

attribute, choice, define, element, except, group, interleave, list, mixed, oneOrMore, optional, start, zeroOrMore

Compact syntax equivalent

empty

Description

empty patterns define nodes that are empty—for example, elements that have no child elements, text, or attributes. Note that it is mandatory to use this pattern explicitly in such cases; the simpler-looking form <element name="foo"/> is forbidden. There is no such thing as an empty attribute. An attribute such as foo=“” is considered to have a value that is the empty string rather than considered empty—i.e., having no value. Therefore, empty applies only to elements.

Example

<element name="pageBreak">
  <empty/>
</element>

Attributes

datatypeLibrary

This attribute defines the default datatype library. The value is inherited.

ns

This attribute defines the default namespace for the elements defined in a portion of schema. The value is inherited.

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.