XML-Data
XML-Data was the first XML schema and is very definitely a programmer's solution, using schemas that define the characteristics of classes of objects.
Schemas are composed of declarations for concepts and classes of objects with class hierarchies, properties, constraints, and relationships.
Like all of the XML data (small d this time!) proposals, XML-Data uses elements and, to identify the significance of the elements, namespaces. The syntax of a typical XML-Data schema looks like this:
XML version='1.0' ?> <?xml:namespace name="urn:uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA110C14882/" as="msschema"/?> <msschema:schema id='ExampleofSchemaSyntax'> <!-- schema goes here. --> </msschema:schema>
| We have already talked a little about namespaces. Normally, namespace declarations point to Web sites that (supposedly) contain vocabularies describing the elements used in the schema; their names, purpose, and content. In this case the pointer is a URN and the address is very similar to a Microsoft Windows Registry entry (just as the Windows Registry entry value is given for the Microsoft Data Source object used to map XML elements onto HTML elements for display in Internet Explorer, as described in Day 12, "Viewing XML in Internet Explorer"). |
XML-Data is, as its name suggests, highly adapted for data. It has datatypes like string and integer; it has constraints, such as maximum and minimum values; it allows multi-part keys, which allows data to be assembled from multiple locations. Perhaps most important of all is the fact that XML-Data allows other schemas, such as database schemas, to be mapped onto the XML-Data schema.