What is ?

XML Declaration

<?xml version="1.0"?> is an XML declaration. It is an optional indication of the version of XML, the character encoding, and the standalone document declaration. It can only appear as the very top of an XML file, if anywhere, and may not be repeated.

<xml version="1.0"> is an open tag (that will require a closing tag) to an XML element. While it would be well-formed (if properly closed), do not use this — it looks too much like an bungled XML declaration. Moreover, the W3C XML Recommendation states:

Names beginning with the string "xml", or with any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification.

Leave a Comment