Name

choice (in the context of a name-class) — Choice between name classes

Synopsis

element choice
{
 (
 attribute ns { text }?,
 attribute datatypeLibrary { xsd:anyURI }?,
 attribute * - (rng:* | local:*) { text }*
 ),
 (
 ( element * - rng:* { ... }* )
 & (
 element name { ... }
 | element anyName { ... }
 | element nsName { ... }
 | element choice { ... }
 )+
 )
}

Class

name-class

May be included in

attribute, choice, element, except

Compact syntax equivalent

nameClass|nameClass

Description

The choice name class makes a choice between several name classes: a name matches choice if, and only if, it matches at least one of the subname classes.

Example

<element>
  <choice>
    <nsName ns="http://eric.van-der-vlist.com/ns/library"/>
    <nsName ns="http://eric.van-der-vlist.com/ns/person"/>
  </choice>
  <ref name="anything"/>
</element>

Attributes

datatypeLibrary

This attribute defines the default datatype library. The value is inherited. Note that although datatypeLibrary is allowed in choice, just as it is in other RELAX NG elements, it has no direct effect on choice itself or on the name class definitions that might be embedded.

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.