Page 16 of 28PREVNEXT

XML: What's it all about?

Schemas can control what goes into the tags in an XML data file

Schemas contain rules that help ensure valid data.

Don't let the term intimidate you. Schema is just another word for structure or organization. In XML, a schema contains the rules for what can and can't be in the various parts of an XML data file.

It's important to keep separate the rules in a schema and the rules for well-formed XML. The rules for well-formed XML dictate how your resident expert or IT department has to build a data structure, including any schemas. A schema is XML, and as such it must conform to the rules for well-formed XML.

In contrast, the rules in a schema dictate what can and can't reside in a given data structure. For example, a schema may say that a certain tag can contain only dates and another can contain only prices. Without a schema, the date field in your well-formed XML could contain text, and your price field could contain dates. Your XML would be like a grammatical, but meaningless, sentence.

A schema can be contained in a data file, or it can be a separate file linked to the data file. Either way, whenever you use a data file in concert with a schema, that data file is said to conform to that schema. If your IT department creates a separate schema file, that schema file uses the file name extension .xsd. Data files use the file name extension .xml.

Page 16 of 28PREVNEXT