Name

xs:restriction

Attributes

base

The type whose content is being modified to create a new type

Contents

xs:annotation?,
(xs:simpleType?, (xs:enumeration | xs:fractionDigits |
                  xs:maxExclusive | xs:maxInclusive |
                  xs:minExclusive | xs:minInclusive |
                  xs:pattern | xs:pattern)* ) |
( (xs:group | xs:all | xs:choice | xs:sequence )?,
( (xs:attribute | xs:attributeGroup)*,
   xs:anyAttribute? ) )
)

xs:restriction allows you to create derived types in which the content model is the same as, or reduced from, the base type. Any type created using xs:restriction must be capable of being validated against the type from which it is derived. The base type may be identified with either the base attribute or the xs:simpleType child element, but not both. The content constraints for simple types must be defined using the vocabulary for simple types, while those for complex types must be defined using the vocabulary for complex types.

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.