Basic XML Schema Declarations

By Lucinda Dykes, Ed Tittel

Part of XML For Dummies Cheat Sheet

An XML Schema document is built of a series of declarations, which gives very detailed information and makes sure the information contained in the XML document is in the correct form.

Declaration Name Purpose Syntax
Schema Identifies the language the schema uses <xsd:schema
Element Defines an element <xsd:element name=”name”>
Attribute Defines an attribute <xsd:attribute name=”name”
Complex type Defines an element that contains other elements, contains
attributes, or contains mixed content (elements and text)
Simple type Creates a constrained datatype for an element or attribute
Sequence compositor Specifies that attributes or elements within a complex type
must be listed in order
Choice compositor Specifies that any one of the attributes or elements within a
complex type can be used
All compositor Specifies that any or all attributes or elements within a
complex type can be used
Annotation Contains documentation and/or appInfo elements that provide
additional information and comments about the schema document
Documentation Provides human-readable information within an annotation <xsd:documentation>
Application information Provides computer-readable information within an