Name

datatypeName param exceptPattern — data pattern

Synopsis

                     datatypeName ["{” 
param* “}"] [
exceptPattern]

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

data

Description

The datatypeName param exceptPattern pattern matches a single text node and allows the possibility of restricting its values. It is different from the text pattern, which matches zero or more text nodes and doesn’t allow the possibility of restricting the values of these text nodes.

In this construction, the restrictions are applied using datatypeName. It defines the datatype, the optional param that defines additional parameters passed to the datatype library (when the datatype library is W3C XML Schema datatypes, these parameters are the W3C XML Schema facets), and the optional exceptPattern. exceptPattern defines exceptions, a set of excluded values.

Restrictions

The datatypeName param exceptPattern pattern is meant for data-oriented applications and can’t be used in mixed-content models.

Example

attribute available {xs:boolean - (xs:boolean "false")}

 element born {xs:date {
   minInclusive = "1900-01-01"
   maxInclusive = "2099-12-31"
   pattern = "[0-9]{4}-[0-9]{2}-[0-9]{2}"
 }}

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.