A schema determines the layout of an XML document’s elements, the attributes and subelements that each can have, and the constraints that the attribute data and element data must adhere to. XML schemas are used to define the structure, content and semantics of XML documents.
As with any XML file, Keynote and Pages XML consists of a series of elements, some of which may contain mixed content, while most include only attributes and/or child elements. Many elements have unique identifiers which allow them to be referenced by other elements.
Despite a number of internal differences, both iWork XML schemas represent an XML document as an ordered, labeled tree in which each node has a unique identity and may have a value, attributes, and namespaces associated with it.
The iWork XML schemas operate on the abstract, logical structure of an XML document—the data model—rather than its surface syntax. The data model represents an XML document as a tree of nodes. The tree can have various kinds of nodes, each of which corresponds to a type of XML construct, such as element, attribute, text, and namespace.
Each node in a tree typically has a unique identity. Most nodes have a name, and many have some string or other type of value associated with them.
To be usable in a particular context, an XML document must be well formed. This means that a document must have open and close tags for all its elements (in the correct sequence) and contain one root element. In addition, XML documents must have at least one XML declaration: an element that provides XML parsers with essential information needed to process a document and ensure that it is valid.
A valid document is one that follows the structure specified by a schema file, such as the Pages or Keynote schema files.
Last updated: 2005-11-09