XML Schema Documentation

Table of Contents

top

Schema Document Properties

Target Namespace None
Element and Attribute Namespaces
  • Global element and attribute declarations belong to this schema's target namespace.
  • By default, local element declarations belong to this schema's target namespace.
  • By default, local attribute declarations have no namespace.

Declared Namespaces

Prefix Namespace
xml http://www.w3.org/XML/1998/namespace
xs http://www.w3.org/2001/XMLSchema
Schema Component Representation
<xs:schema elementFormDefault="qualified">
...
</xs:schema>
top

Global Declarations

Element: address

Name address
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<address>
<line1> AddressLine </line1> [1]
<line2> AddressLine </line2> [1]
<line3> AddressLine </line3> [1]
<line4> AddressLine </line4> [1]
<line5> AddressLine </line5> [1]
<line6> AddressLine </line6> [1]
</address>
Schema Component Representation
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element name="line1" type=" AddressLine "/>
<xs:element name="line2" type=" AddressLine "/>
<xs:element name="line3" type=" AddressLine "/>
<xs:element name="line4" type=" AddressLine "/>
<xs:element name="line5" type=" AddressLine "/>
<xs:element name="line6" type=" AddressLine "/>
</xs:sequence>
</xs:complexType>
</xs:element>
top

Element: document

Name document
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<document>
<pages> ... </pages> [1..*]
</document>
Schema Component Representation
<xs:element name="document">
<xs:complexType>
<xs:sequence>
<xs:element ref=" pages " maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
top

Element: envelope

Name envelope
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<envelope
envelopename=" xs:NMTOKEN [1]"
insertname=" xs:NMTOKENS [0..1]"
postage=" xs:NCName (value comes from list: {'A'|'B'|'B2'}) [1]"
senddatefrom=" xs:date [1]"
senddateto=" xs:date [1]"
shippingregion=" ShippingRegion [1]">
<address> ... </address> [1]
<index> ... </index> [0..*]
<document> ... </document> [1]
<sender> ... </sender> [1]
</envelope>
Schema Component Representation
<xs:element name="envelope">
<xs:complexType>
<xs:sequence>
<xs:element ref=" address "/>
<xs:element ref=" index " minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref=" document "/>
<xs:element ref=" sender "/>
</xs:sequence>
<xs:attribute name="envelopename" type=" xs:NMTOKEN " use="required"/>
<xs:attribute name="insertname" type=" xs:NMTOKENS " use="optional"/>
<xs:attribute name="postage" use="required">
<xs:simpleType>
<xs:restriction base=" xs:NCName ">
<xs:enumeration value="A"/>
<xs:enumeration value="B"/>
<xs:enumeration value="B2"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="senddatefrom" type=" xs:date " use="required"/>
<xs:attribute name="senddateto" type=" xs:date " use="required"/>
<xs:attribute name="shippingregion" type=" ShippingRegion " use="required"/>
</xs:complexType>
</xs:element>
top

Element: envelopedefinitions

Name envelopedefinitions
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<envelopedefinitions>
<!--
Uniqueness Constraint - EnvelopeNames
Selector - envelopedefinition
Field(s) - @name
-->

<envelopedefinition
name=" xs:NMTOKEN [1]"/> [1..*]
</envelopedefinitions>
Schema Component Representation
<xs:element name="envelopedefinitions">
<xs:complexType>
<xs:sequence>
<xs:element name="envelopedefinition" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type=" xs:NMTOKEN " use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="EnvelopeNames">
<xs:selector xpath="envelopedefinition"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
top

Element: index

Name index
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<index
name=" xs:NMTOKEN [1]"
value=" xs:string [1]"/>
Schema Component Representation
<xs:element name="index">
<xs:complexType>
<xs:attribute name="name" type=" xs:NMTOKEN " use="required"/>
<xs:attribute name="value" type=" xs:string " use="required"/>
</xs:complexType>
</xs:element>
top

Element: insertdefinitions

Name insertdefinitions
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<insertdefinitions>
<!--
Uniqueness Constraint - InsertNames
Selector - insertdefinition
Field(s) - @name
-->

<insertdefinition
name=" xs:NMTOKEN [1]"
stationnr=" xs:positiveInteger [1]"/> [0..*]
</insertdefinitions>
Schema Component Representation
<xs:element name="insertdefinitions">
<xs:complexType>
<xs:sequence>
<xs:element name="insertdefinition" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type=" xs:NMTOKEN " use="required"/>
<xs:attribute name="stationnr" type=" xs:positiveInteger " use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="InsertNames">
<xs:selector xpath="insertdefinition"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
top

Element: mediumdefinitions

Name mediumdefinitions
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<mediumdefinitions>
<!--
Uniqueness Constraint - MediumNames
Selector - mediumdefinition
Field(s) - @name
-->

<mediumdefinition
name=" xs:NMTOKEN [1]"/> [1..*]
</mediumdefinitions>
Schema Component Representation
<xs:element name="mediumdefinitions">
<xs:complexType>
<xs:sequence>
<xs:element name="mediumdefinition" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type=" xs:NMTOKEN " use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="MediumNames">
<xs:selector xpath="mediumdefinition"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
top

Element: overlaydefinitions

Name overlaydefinitions
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<overlaydefinitions>
<!--
Uniqueness Constraint - OverlayNames
Selector - overlaydefinition
Field(s) - @name
-->

<overlaydefinition
name=" xs:NMTOKEN [1]"/> [0..*]
</overlaydefinitions>
Schema Component Representation
<xs:element name="overlaydefinitions">
<xs:complexType>
<xs:sequence>
<xs:element name="overlaydefinition" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type=" xs:NMTOKEN " use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="OverlayNames">
<xs:selector xpath="overlaydefinition"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
top

Element: pages

Name pages
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<pages
duplex=" xs:boolean [1]"
mediumname=" xs:NMTOKEN [1]"
underlay=" xs:NMTOKENS [0..1]"
overlay=" xs:NMTOKENS [0..1]"/>
Schema Component Representation
<xs:element name="pages">
<-- TODO Shouldn't that be "page"? -->
<xs:complexType>
<xs:attribute name="duplex" type=" xs:boolean " use="required"/>
<xs:attribute name="mediumname" type=" xs:NMTOKEN " use="required"/>
<xs:attribute name="underlay" type=" xs:NMTOKENS " use="optional"/>
<xs:attribute name="overlay" type=" xs:NMTOKENS " use="optional"/>
</xs:complexType>
</xs:element>
top

Element: printfile

Name printfile
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<printfile
filename=" xs:anyURI [1]">
<!--
Key Constraint - MediumDefinitionKey
Selector - mediumdefinitions/mediumdefinition
Field(s) - @name
-->
<!--
Key Reference Constraint - MediumDefinitionKeyRef
Selector - envelope/document/pages
Field(s) - @mediumname
Refers to - MediumDefinitionKey
-->
<!--
Key Constraint - EnvelopeDefinitionKey
Selector - envelopedefinitions/envelopedefinition
Field(s) - @name
-->
<!--
Key Reference Constraint - EnvelopeDefinitionKeyRef
Selector - envelope
Field(s) - @envelopename
Refers to - EnvelopeDefinitionKey
-->

<mediumdefinitions> ... </mediumdefinitions> [1]
<envelopedefinitions> ... </envelopedefinitions> [1]
<insertdefinitions> ... </insertdefinitions> [1]
<overlaydefinitions> ... </overlaydefinitions> [1]
<envelope> ... </envelope> [1..*]
</printfile>
Schema Component Representation
<xs:element name="printfile">
<xs:complexType>
<xs:sequence>
<xs:element ref=" mediumdefinitions "/>
<xs:element ref=" envelopedefinitions "/>
<xs:element ref=" insertdefinitions "/>
<xs:element ref=" overlaydefinitions "/>
<xs:element ref=" envelope " maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="filename" type=" xs:anyURI " use="required"/>
</xs:complexType>
<xs:key name="MediumDefinitionKey">
<xs:selector xpath="mediumdefinitions/mediumdefinition"/>
<xs:field xpath="@name"/>
</xs:key>
<xs:keyref name="MediumDefinitionKeyRef" refer=" MediumDefinitionKey ">
<xs:selector xpath="envelope/document/pages"/>
<xs:field xpath="@mediumname"/>
</xs:keyref>
<xs:key name="EnvelopeDefinitionKey">
<xs:selector xpath="envelopedefinitions/envelopedefinition"/>
<xs:field xpath="@name"/>
</xs:key>
<xs:keyref name="EnvelopeDefinitionKeyRef" refer=" EnvelopeDefinitionKey ">
<xs:selector xpath="envelope"/>
<xs:field xpath="@envelopename"/>
</xs:keyref>
<-- NMTOKEN -> NMTOKENS relation not mappable with XML Schema 1.0 <xs:key name="InsertDefinitionKey"> <xs:selector xpath="insertdefinitions/insertdefinition"/> <xs:field xpath="@name"/> </xs:key> <xs:keyref name="InsertDefinitionKeyRef" refer="InsertDefinitionKey"> <xs:selector xpath="envelope"/> <xs:field xpath="@insertname"/> </xs:keyref> -->
</xs:element>
top

Element: sender

Name sender
Type Locally-defined complex type
Nillable no
Abstract no
XML Instance Representation
<sender>
<name> xs:string </name> [1]
<zip> PLZ </zip> [1]
<city> xs:string </city> [1]
<referencenr> xs:string </referencenr> [1]
</sender>
Schema Component Representation
<xs:element name="sender">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type=" xs:string "/>
<xs:element name="zip" type=" PLZ "/>
<xs:element name="city" type=" xs:string "/>
<xs:element name="referencenr" type=" xs:string "/>
</xs:sequence>
</xs:complexType>
</xs:element>
top

Global Definitions

Simple Type: AddressLine

Super-types: xs:string < AddressLine (by restriction)
Sub-types: None
Name AddressLine
Content
  • Base XSD Type: string
Schema Component Representation
<xs:simpleType name="AddressLine">
<xs:restriction base=" xs:string "/>
</xs:simpleType>
top

Simple Type: PLZ

Super-types: xs:positiveInteger < PLZ (by restriction)
Sub-types: None
Name PLZ
Content
  • Base XSD Type: positiveInteger
  • 1000 <= value <= 9999
Schema Component Representation
<xs:simpleType name="PLZ">
<xs:restriction base=" xs:positiveInteger ">
<xs:minInclusive value="1000"/>
<xs:maxInclusive value="9999"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: ShippingRegion

Super-types: xs:positiveInteger < ShippingRegion (by restriction)
Sub-types: None
Name ShippingRegion
Content
  • Base XSD Type: positiveInteger
  • value comes from list: {'1'|'2'|'3'}
Schema Component Representation
<xs:simpleType name="ShippingRegion">
<xs:restriction base=" xs:positiveInteger ">
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
<xs:enumeration value="3"/>
</xs:restriction>
</xs:simpleType>
top

Legend

Complex Type:

Schema Component Type

AusAddress

Schema Component Name
Super-types: Address < AusAddress (by extension)
Sub-types:
  • QLDAddress (by restriction)
If this schema component is a type definition, its type hierarchy is shown in a gray-bordered box.
Name AusAddress
Abstract no
The table above displays the properties of this schema component.
XML Instance Representation
<... country="Australia" >
<unitNo> string </unitNo> [0..1]
<houseNo> string </houseNo> [1]
<street> string </street> [1]
Start Choice [1]
<city> string </city> [1]
<town> string </town> [1]
End Choice
<state> AusStates </state> [1]
<postcode> string <<pattern = [1-9][0-9]{3}>> </postcode> [1] ?
</...>

The XML Instance Representation table above shows the schema component's content as an XML instance.

Schema Component Representation
<complexType name="AusAddress">
<complexContent>
<extension base=" Address ">
<sequence>
<element name="state" type=" AusStates "/>
<element name="postcode">
<simpleType>
<restriction base=" string ">
<pattern value="[1-9][0-9]{3}"/>
</restriction>
</simpleType>
</element>
</sequence>
<attribute name="country" type=" string " fixed="Australia"/>
</extension>
</complexContent>
</complexType>
The Schema Component Representation table above displays the underlying XML representation of the schema component. (Annotations are not shown.)
top

Glossary

Abstract (Applies to complex type definitions and element declarations). An abstract element or complex type cannot used to validate an element instance. If there is a reference to an abstract element, only element declarations that can substitute the abstract element can be used to validate the instance. For references to abstract type definitions, only derived types can be used.

All Model Group Child elements can be provided in any order in instances. See: http://www.w3.org/TR/xmlschema-1/#element-all.

Choice Model Group Only one from the list of child elements and model groups can be provided in instances. See: http://www.w3.org/TR/xmlschema-1/#element-choice.

Collapse Whitespace Policy Replace tab, line feed, and carriage return characters with space character (Unicode character 32). Then, collapse contiguous sequences of space characters into single space character, and remove leading and trailing space characters.

Disallowed Substitutions (Applies to element declarations). If substitution is specified, then substitution group members cannot be used in place of the given element declaration to validate element instances. If derivation methods, e.g. extension, restriction, are specified, then the given element declaration will not validate element instances that have types derived from the element declaration's type using the specified derivation methods. Normally, element instances can override their declaration's type by specifying an xsi:type attribute.

Key Constraint Like Uniqueness Constraint, but additionally requires that the specified value(s) must be provided. See: http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions.

Key Reference Constraint Ensures that the specified value(s) must match value(s) from a Key Constraint or Uniqueness Constraint. See: http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions.

Model Group Groups together element content, specifying the order in which the element content can occur and the number of times the group of element content may be repeated. See: http://www.w3.org/TR/xmlschema-1/#Model_Groups.

Nillable (Applies to element declarations). If an element declaration is nillable, instances can use the xsi:nil attribute. The xsi:nil attribute is the boolean attribute, nil, from the http://www.w3.org/2001/XMLSchema-instance namespace. If an element instance has an xsi:nil attribute set to true, it can be left empty, even though its element declaration may have required content.

Notation A notation is used to identify the format of a piece of data. Values of elements and attributes that are of type, NOTATION, must come from the names of declared notations. See: http://www.w3.org/TR/xmlschema-1/#cNotation_Declarations.

Preserve Whitespace Policy Preserve whitespaces exactly as they appear in instances.

Prohibited Derivations (Applies to type definitions). Derivation methods that cannot be used to create sub-types from a given type definition.

Prohibited Substitutions (Applies to complex type definitions). Prevents sub-types that have been derived using the specified derivation methods from validating element instances in place of the given type definition.

Replace Whitespace Policy Replace tab, line feed, and carriage return characters with space character (Unicode character 32).

Sequence Model Group Child elements and model groups must be provided in the specified order in instances. See: http://www.w3.org/TR/xmlschema-1/#element-sequence.

Substitution Group Elements that are members of a substitution group can be used wherever the head element of the substitution group is referenced.

Substitution Group Exclusions (Applies to element declarations). Prohibits element declarations from nominating themselves as being able to substitute a given element declaration, if they have types that are derived from the original element's type using the specified derivation methods.

Target Namespace The target namespace identifies the namespace that components in this schema belongs to. If no target namespace is provided, then the schema components do not belong to any namespace.

Uniqueness Constraint Ensures uniqueness of an element/attribute value, or a combination of values, within a specified scope. See: http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions.

top