File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Versioning in XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Versioning in XML" Watch "Versioning in XML" New topic
Author

Versioning in XML

N Jain
Greenhorn

Joined: Mar 26, 2001
Posts: 7
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

Joined: Feb 06, 2001
Posts: 358
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.

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
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.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
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?
 
 
subject: Versioning in XML
 
Similar Threads
[Solved] Unexpected behaviour of HTML
What do I need to start developing REST apps ?
Is it jdk1.5 or jdk5?
What's your favorite open source library/project?
Tomcat 7 maintaining more than one session