|
|
An XML document begins by identifying itself as an XML document. The following represents a typical introduction to an XML document:
<?xml version="1.0" standalone="yes" encoding="UTF-8"?> <!DOCTYPE Order [ . . . <! -- DTD specifications --> ]
The first expression declares the XML version to which the document conforms. Our document is a version 1.0 document.
Our document is also a standalone XML document, without references to other documents. Since it is a standalone document, it must contain its DTD, if one exists. It is possible for a simple standalone XML document to have no DTD.
Finally, the first line states that the document can contain only 8-bit ASCII characters. An XML document can contain 16-bit characters, similar to Unicode in Java. If this document were a 16-bit document, the required syntax would be encoding= 'UTF-16.'
The next line in the type declaration identifies the document type as Order. An Order comprises all the elements and attributes specified. These directives will be included inside the braces ([]).
The exclamation point is a tag that represents a comment. The text between <! and the closing > will be ignored by an XML parsing program.
|
|