Name

rng:param — Specifies a parameter for a datatype

XML syntax example

<element name="digit"
 datatypeLibrary="http://www.w3.org/2001/XMLSchema-
 datatypes">
 <data type="int">
  <param name="minInclusive">0</param>
  <param name="maxInclusive">9</param>
 </data>
</element>

Compact syntax example

element digit { xsd:int { minInclusive = "0" maxInclusive = "9" } }

Attributes

name

The name of the parameter (facet)

Parents

data

Description

The param element specifies a parameter that is associated with a datatype specified by a parent data element. These parameters are called facets in the context of XML Schema datatypes (Table 1-5). The XML Schema datatype library is the most common datatype library associated with a RELAX NG schema, though others are possible.

Table 1-5. XML Schema datatype facets

Facet

Description

length

Length in units

minLength

Minimum length in units

maxLength

Maximum length in units

pattern

A regular expression

minInclusive

Minimum inclusive value

maxInclusive

Maximum inclusive value

minExclusive

Minimum exclusive value

maxExclusive

Maximum exclusive value

totalDigits

Total number of digits

fractionDigits

Number of digits to the right of the decimal point

Tip

The enumeration and whitespace facets of XML Schema datatypes are not supported by RELAX NG.

See also

§5, data, list, value

Get XML Pocket Reference, 3rd Edition 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.