by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Name

data — data pattern

Synopsis

element data
{
 attribute type { xsd:NCName },
 (
 attribute ns { text }?,
 attribute datatypeLibrary { xsd:anyURI }?,
 attribute * - (rng:* | local:*) { text }*
 ),
 (
 ( element * - rng:* { ... }* )
 & ( element param { ... }*, element except { ... }? )
 )
}

Class

pattern

May be included in

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

Compact syntax equivalent

datatypeName param exceptPattern

Description

The data pattern matches a single text node (i.e., token, or attribute value) and gives the possibility of restricting its values. It is different from the text pattern, which matches zero or more text nodes and doesn't give any option for restricting the values of these text nodes. The restrictions are applied through the type attribute, which defines the datatype and the param and except child patterns.

Restrictions

The data pattern is meant for data-oriented applications and can't be used in mixed content models.

Example

<attribute name="see-also">
 <list>
  <data type="token"/>
 </list>
</attribute>
    
<attribute name="id">
 <data type="NMTOKEN">
   <param name="maxLength">16</param>
 </data>
</attribute>
<element name="isbn">
 <data type="token">
  <except>
   <value>0836217462</value>
  </except>
 </data>
</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 a schema. The value is inherited.

type

This attribute specifies the datatype used to evaluate the data pattern. Any text node whose value isn't valid according to this datatype fails to match the data pattern.


This text is released under the Free Software Foundation GFDL.