Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema Reference Manual

XML Schema Reference Manual


XSD Elements

Element Explanation
all Specifies that child elements can appear in any order, and each child element can occur zero or one time.
annotation The annotation element is a top-level element that specifies comments for the schema.
any Allows authors to extend the XML document with elements not specified by the schema.
anyAttribute Allows authors to extend the XML document with attributes not specified by the schema.
appInfo Specifies information in the annotation element for applications to use.
attribute Defines an attribute.
attributeGroup Defines an attribute group to be used in a complex type definition.
choice Allows only one element from the declaration to appear in the containing element.
complexContent Defines an extension or restriction of a complex type (containing mixed content or element-only content).
complexType Defines a complex type.
documentation Defines a text comment in the schema.
element Defines an element.
extension Extends an existing simpleType or complexType element.
field Specifies an XPath expression that defines the values used to define an identity constraint.
group Defines an element group to be used in a complex type definition.
import Adds multiple schemas with different target namespaces to a document.
include Adds multiple schemas with the same target namespace to a document.
key Specifies that an attribute or element value (or a set of values) must be a key within a specified scope.
keyref Specifies that an attribute or element value (or a set of values) corresponds to the value of a specified key or unique element.
list Defines a simple type as a list of values of a specified data type.
notation Describes the format of non-XML data in an XML document.
redefine Redefines simple and complex types, groups, and attribute groups obtained from an external schema file.
restriction Defines a restriction on a simpleType, simpleContent, or complexContent.
schema Defines the root element of a schema.
selector Specifies an XPath expression that selects a set of elements for an identity constraint.
sequence Requires child elements to appear in order. Each child element can occur from 0 to any number of times.
simpleContent Contains an extension or restriction of a complexType element and does not contain any elements.
simpleType Defines a simple type, specifying restrictions and information about the values of attributes or text-only elements.
union Defines a collection of multiple simpleType definitions.
unique Specifies that an attribute or element value (or a combination of attribute or element values) must be unique within a specified scope.

XSD Restriction/Facets

See XSD Restriction / Facets

Limit Description
enumeration Defines a list of acceptable values
fractionDigits Defines the maximum number of decimal places allowed. Must be greater than or equal to 0.
length Defines the exact number of characters or list items allowed. Must be greater than or equal to 0.
maxExclusive Defines the upper bound for numeric values. Allowed values must be less than this value.
maxInclusive Defines the upper bound for numeric values. Allowed values must be less than or equal to this value.
maxLength Defines the maximum number of characters or list items allowed. Must be greater than or equal to 0.
minExclusive Defines the lower bound for numeric values. Allowed values must be greater than this value.
minInclusive Defines the lower bound for numeric values. Allowed values must be greater than or equal to this value.
minLength Defines the minimum number of characters or list items allowed. Must be greater than or equal to 0.
pattern Defines the exact sequence of acceptable characters.
totalDigits Defines the exact number of digits allowed. Must be greater than 0.
whiteSpace Defines how whitespace characters (line feeds, carriage returns, spaces, and tabs) are handled.