Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Versioning in XML

 
N Jain
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is said abt XML that it is open standard and there is nothing like versioning of XML (unlike HTML 3.2 HTML 4.0 etc.). So why do we write <?xml version="1.0"?> at the beginning of every XML doc?
Thanks in advance for the reply,
N
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The declaration part in XML is actually optional. But it's a good idea to include it whenever you create an XML file. The declaration should have the version number, at a minimum, and ideally the encoding as well. That standard simplifies things if the XML standard is extended in the future, and if the data ever needs to be localized for different geographical regions.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not to forget, some parsers actually use the version tag to check the compatibility even before looking at the other elements.
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajith,
According to you some parsers use version tag to check compatibilty. In case the parser doesn't finds the version tag, will it give an error?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic