TopicsNext topics |
Step One: Make an XML DeclarationThe goal of this step is to create an XML declaration, which declares the nature of XML documents to document readers. Without this declaration, a document reader might mis-identify an XML document as SGML, HTML or RTF, causing interpretation problems. Every XML document should use an XML declaration, to state its nature to XML document readers. Editors, browsers and document processors use the declaration to determine how a document should be processed. The declaration becomes increasingly important with large and complex documents but should also be used in smaller and experimental documents. The XML declaration includes information on markup language, markup language version, presence of external markup declarations and character encoding. Your Well-Formed XML InstanceYou should build your own XML document, as you go through the tutorial. Look to Your Well-Formed XML Instance as you read through the tutorial, for guidance and as an example. Your document may be quite different than this example but should be built in a similar way. Your document should begin with an XML declaration and should be identical to this document at this early stage of document development. <?xml version="1.0" standalone="yes"?>
XML DeclarationThese XML declarations are commonly used for various types of XML authoring. The first two declarations can be used to describe well-formed and valid XML documents, respectively. The third declaration can be considered the default XML declaration, stating that it is an XML version 1.0 document, that it cannot standalone from external markup declarations and that it is encoded in UTF-8, an 8 bit Unicode character encoding. Use the first XML declaration when creating your own well-formed XML documents. <?xml version="1.0" standalone="yes"?>
<?xml version="1.0" standalone="no"?>
<?xml version="1.0" standalone="no" encoding="UTF-8"?>
XML Declaration Components
<Beginning of Document> <Table of Contents> <Previous> <Next> |