The document prolog is followed by a series of "elements". An element, which is the basic unit of XML, consists of textual content (or "character data"), enhanced with descriptive tags (or "markup"). The boundaries of an element are defined by start and end tags, and may contain additional descriptive "attributes". Here are some examples of XML elements: XML also allows for so-called empty elements - essentially, elements which have no content and therefore do not require a closing tag. Such elements are closed by adding a slash (/) to the end of their opening tag. For example, An element name must begin with a letter, optionally followed by more letters and numbers. For example, are all valid element names. Element names are case sensitive - so is different from or An element may contain only text, or a combination of text and other elements. In order to be well-formed, an XML document must contain at least one non-empty element. This outermost element is called the "root element" and, in turn, may contain other elements, nested in a hierarchical manner. In the first example above, the root element would be <review>...</review>. This article copyright Melonfire 2001. All rights reserved.
blog comments powered by Disqus |