The XML declaration is a processing instruction that identifies the document as being XML. All XML documents should begin with an XML declaration.
<?xml version="version_number" encoding="encoding_declaration" standalone="standalone_status" ?> |
Example: |
---|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
Rules:
Note:
The following table shows a list of the possible attributes that may be used in the XML declaration.
Attribute name: | Possible attribute value: | Attribute description: |
---|---|---|
version | 1.0 | Specifies the version of the XML standard that the XML document conforms to. The version attribute must be included if the XML declaration is declared![]() |
encoding | UTF-8, UTF-16, ISO-10646-UCS-2, ISO-10646-UCS-4, ISO-8859-1 to ISO-8859-9, ISO-2022-JP, Shift_JIS, EUC-JP | These are the encoding names![]() ![]() |
standalone | yes, no | Use 'yes' if the XML document has an internal DTD. Use 'no' if the XML document is linked to an external DTD, or any external entity references![]() |