xs:schema

Purpose This element enables you to define a whole schema in TSD.
Parent element None; xs:schema is the root element of the logical schema tree.
Child elements xs:annotation, xs:attribute, xs:attributeGroup, xs:complexType, xs:element, xs:group, xs:import, xs:include, xs:notation, xs:simpleType
Attributes attributeFormDefault, blockDefault, elementFormDefault, finalDefault, targetNamespace, version and namespace declarations
Restrictions

The following restriction applies for the xs:schema element:

  • If a targetNamespace attribute is present in an xs:schema element, it must not be empty.

Table of attributes
Name Type Description
attributeFormDefault xs:NMTOKEN

This attribute affects the representation of attributes in instance documents and the checking of the qualification of locally-declared attributes during the schema validation process. It decides whether the appearance of locally-declared attributes in an instance document must be qualified by a namespace specification. It can be set to the values "qualified" or "unqualified". Setting the attributeFormDefault attribute to the value "unqualified" means that all local attributes are excluded from the according namespace (that was specified with the targetNamespace attribute). This is the default setting for the attributeFormDefault attribute.

Otherwise, all attributes matching locally-defined attributes must be qualified by a namespace declaration. The value of the attributeFormDefault attribute can be overridden using the form attribute of locally-defined attributes.

blockDefault xs:blockSet This attribute specifies the default for the block attribute of xs:element and xs:complexType in the current schema document. Please refer to the documentation of those elements for a list of valid values.
elementFormDefault xs:NMTOKEN

This attribute affects the representation of elements in instance documents and the checking of the qualification of locally-declared elements during the schema validation process. It decides whether the appearance of locally-declared elements in an instance document must be qualified by a namespace specification. It can be set to the values "qualified" or "unqualified". Setting the elementFormDefault attribute to the value "unqualified" means that all local elements are excluded from the namespace of the schema (that was specified with the targetNamespace attribute ). This is the default setting for the elementFormDefault attribute.

Otherwise, all elements matching locally-defined elements must be qualified by a namespace declaration. The value of elementFormDefault can be overridden using the form attribute of locally-defined elements.

finalDefault xs:fullDerivationSet This attribute specifies the default for the final attribute of xs:element and xs:complexType in the current schema document. Please refer to the documentation of those elements for a list of valid values.
targetNamespace xs:anyURI

This attribute defines a target namespace for the schema. This is done by specifying a URI that uniquely identifies the namespace. There must be a corresponding namespace declaration using the same URI.

version xs:token

This attribute specifies version information.

For more information about target namespaces and qualification in xs:schema definitions, see Advanced Concepts I: Namespaces, Schemas & Qualification in W3C´s introductory document XML Schema Part 0: Primer, especially the section Target Namespaces & Unqualified Locals.

Examples

There are three large examples in the appendix of the Tamino XML Schema User Guide.