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
(www.w3.org/TR/xml/). XML allows developers to create their own document elements
or tags. The World Wide Web Consortium (W3C, www.w3.org) 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,
www.corefiling.com/opensource/schemaValidate.html, you can check the syntax of your
XML document at www.w3schools.com/dom/dom_validate.asp or check for a valid DTD at
www.xmlvalidation.com/. 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
Rules
1
Must contain at least one properly tagged element.
2
Must contain a unique start and end tag that includes the entire document.
3
All remaining tags must be nested properly and may not overlap.
4
XML tags are case sensitive.
5
An XML document must contain at least one root element and nest the child elements
within the root.
6
All elements include a start and end tag.
7
Element attribute values must be enclosed in quotation marks.
8
Elements can be empty; empty elements must be formatted correctly to include
a / (forward slash) before the end tag.
9
Only entity references may use < and & characters.
Search WWH ::




Custom Search