An overview of XML Schema
The structure of an XML document is represented by an XML schema. An XML schema is also an XML document in the namespace http://www.w3.org/2001/XMLSchema.
Root element
The root element in a schema is schema
. The schema namespace is specified in the root element with the declaration xmlns:xs=http://www.w3.org/2001/XMLSchema
. A prefix other than xs
may be used, such as xsd
. A schema
element may have attributes targetNamespace, version, attributeFormDefault
, and elementFormDefault
.
targetNamespace
specifies the namespace described in the schema. "An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names." (http://www.w3.org/TR/1999/REC-xml-names-19990114/)elementFormDefault
andattributeFormDefault
specify whether elements and attributes in thetargetNamespace
are required to be qualified by default.
A qualified name consists of a prefix that is mapped to a namespace URI followed...