HTML and CSS Reference
In-Depth Information
Appendix H
XML Quick Reference
What Is XML?
Extensible Markup Language ( XML ) is a subset of the Standard Generalized
Markup Language (SGML). The current version of XML is version 1.0, and the
fifth edition is not a new version but an update of changes based on reported errors
( XML allows developers to create their own document elements
or tags. The World Wide Web Consortium (W3C, develops the standards
for XML and other Web languages.
An XML document consists of two main parts: the prolog and the document
instance. The prolog contains processing instructions and any additional comments
necessary to provide information about the document's content and structure. An XML
prolog can include any of the following:
XML declaration statements and comments
Document type declaration with an optional Document Type Definition (DTD)
to define elements, attributes, and logical relationships of data
Optional link to either a CSS or XSL style sheet
The document instance contains the main content or elements of the XML
document and provides a logical structure for the document.
Well-Formed and Valid XML Documents
XML documents must be well-formed to be processed by an application. A valid XML
document is one that adheres to the rules and structure specified in a DTD or an XML
Schema Definition (XSD). The element is the basic building block of any XML file.
Table H-1 shows the syntax rules that define well-formed and valid XML documents. An
XML document must be at least well-formed. Besides the Web site shown in Chapter 12,, you can check the syntax of your
XML document at or check for a valid DTD at See the Web sites for instructions on how to use and validate
XML documents.
Table H-1 Rules for Well-Formed and Valid XML Documents
Rule Number
Must contain at least one properly tagged element.
Must contain a unique start and end tag that includes the entire document.
All remaining tags must be nested properly and may not overlap.
XML tags are case sensitive.
An XML document must contain at least one root element and nest the child elements
within the root.
All elements include a start and end tag.
Element attribute values must be enclosed in quotation marks.
Elements can be empty; empty elements must be formatted correctly to include
a / (forward slash) before the end tag.
Only entity references may use < and & characters.
Search WWH ::

Custom Search