Extensible Markup Language (XML) is a simple, very flexible text format. Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere. An XML document is simply a file which follows the XML format.
The purpose of a DTD or a Schema is to define the legal building blocks of an XML document. The AD, SCC, PMIOD and SMIOC XML documents must follows the Schemas files ad.xsd, scc.xsd, pmiod.xsd and smioc.xsd respectively, available in the directory oasis4/util/ xmlfiles.
The xmllint command with the following options can be used to validate an XML file file.xml against a Schema file file.xsd:
xmllint -noout -valid -postvalid -schema file.xsd file.xml
The building blocks of XML documents are Elements, Tags, and Attributes.
Elements are the main building blocks of XML documents.
Examples of XML elements in pmiod.xsd are component or code. Elements can contain text, other elements, or be empty.
The values of minOccurs and maxOccurs for an element in the Schema file indicate how many times this element must occur in the corresponding XML file; if minOccurs and maxOccurs are not specified, the element must appear once.
Tags are used to markup elements.
In the XML file, a starting tag like
element_name
marks up the
beginning of an element, and an ending tag like
/element_name
marks up the end of an element.
Example:
laboratory
Meteo-France
/laboratory
An empty element will appear as
element_name /
.
Attributes provide extra information about elements and are placed inside the start tag of an element. As indicated in the Schema file, an attribute may be ``required'' (use='required') or ``optional'' (use='optional').
Example:
grid local_name="AT31_2D"
The name of the element is ``grid''. The name of the attribute is ``local_name''. The value of the attribute is ``AT31_2D''.