Share via


XML Overview

This is preliminary documentation and subject to change.

XML is a markup language like HTML, and is relatively easy to learn. This section is not meant as a comprehensive tutorial, but rather a quick overview with definitions of the key terms used in this guide.

The HD DVD specification requires that all XML documents meet all syntactic and well-formedness constraints for XML v1.1 as specified by the W3C consortium.

An XML document can be recognized by the fact that it always starts with a special XML tag (for example, <?xml?>). An XML document consists of elements, tags, and attributes. An XML document must have exactly one top-level element.

A tag is a sequence of characters starting with a < character and ending with a > character. An opening tag is used to identify the beginning of an element, and a closing tag is used to identify the end of an element. A closing tag is identified by a / character preceding the name. For example, a simple element used for displaying text uses a <p> opening tag and a </p> closing tag to create a paragraph element. This could look like the following:

<p>Hello World!</p>

Elements can contain a mixture of text and other elements. An element that contains no text and no sub-elements can also be written using the following shorthand:

<p />

An opening tag can contain attributes of the following form:

name="value"

Or alternatively:

name='value'

The following example associates extra information with an element:

<p style:color="red">I'm red text!</p>

XML documents can also contain comments of the following form:

<!-- This is a comment. -->

XML documents can be more complex than what is outlined here, due to optional additions such as inline Document Type Definitions (DTDs) and entities, but that is beyond the scope of this tutorial.

See Also