Is it necessary to do that ? What purpose does it serve besides telling which version of XML is used by that file ? I also read that some programs need to parse xml. So, I guess that these programs need to know the version. Is there any other reason ?
Share
XML version is a part of XML header line, like:
According to standard it is optional, so you don’t need to specify it (your XML will be well formed even without this line), but in this case parser will do some assumptions. As for the version – right now it is not so important, but you should remember that if your XML document does not conform to the version specified then your document has an error. So in future when new features will be introduced this document can be invalid, because the default version for parser will be the latest version.