• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 37. Toward XML > The Prolog: The XML Declaration

The Prolog: The XML Declaration

Every XML document should begin with an XML declaration that identifies the file as an XML file and also identifies the version of XML being used in this particular document. The fact that this is not mandatory is due only to the fact that there are many HTML and SGML files lying about on the Web that were perfectly well-formed XML as well. Why break what's already working? The XML declaration is also the place you declare your encoding and whether the document is standalone. The order shown in the following snippet is mandatory, although the encoding and standalone attributes are both optional:

<?xml version="1.0" encoding=" ISO-8859-1" standalone="yes">


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint