XML Schema Elements
Complete XML Schema Reference Manual
Definition and Usage
The schema element defines the root element of a schema.
Element Information
- Parent elements: (No parent elements)
Syntax
id=ID attributeFormDefault=qualified|unqualified elementFormDefault=qualified|unqualified blockDefault=(#all|list of (extension|restriction|substitution)) finalDefault=(#all|list of (extension|restriction|list|union)) targetNamespace=anyURI version=token xmlns=anyURI any attributes ((include|import|redefine|annotation)*,(((simpleType|complexType| group|attributeGroup)|element|attribute|notation),annotation*)*) Optional. The form of attributes declared in the target namespace of this schema. The value must be one of the following strings: "qualified" or "unqualified". The default is "unqualified". Optional. The form of elements declared in the target namespace of this schema. The value must be one of the following strings: "qualified" or "unqualified". The default is "unqualified". Optional. Specifies the default value of the block attribute on element and complexType elements in the target namespace. The block attribute prevents complex types (or elements) with the specified derivation from being used in place of the inherited complex type (or element). The value can contain #all or a list that is a subset of extension, restriction, or substitution: Optional. Specifies the default value of the final attribute on element, simpleType, and complexType elements in the target namespace of the schema. The final attribute prevents the specified derivation of element, simpleType, or complexType elements. For element and complexType elements, the value can contain #all or a list that is a subset of extension or restriction. For simpleType elements, the value can also contain list and union: A URI reference to the namespace of the schema. A prefix for the namespace can also be assigned. If no prefix is assigned, the schema components of that namespace can be used with unqualified references. Optional. Specifies the version of the schema. Specifies URI references of one or more namespaces used in this schema. If no prefix is assigned, the schema components of that namespace can be used with unqualified references. Optional. Specifies any other attributes with a non-schema namespace. In this example, schema components in the http://www.w3.org/2001/XMLSchema namespace (element name, type) are unqualified, while http://www.w3school.com.cn/w3schoolschema (mystring) is qualified by the wsc prefix: xmlns:wsc="http://www.w3cschool.cc/w3shoolsschema">
property
Description
id
Optional. Specifies a unique ID for the element.
attributeFormDefault
| | blockDefault |
| | finalDefault |
| | targetNamespace |
Example 1
Example 2
Complete XML Schema Reference Manual