A big disadvantage of this metadata, however, is the consequent increase in the size of the fi le. The
metadata adds about 130 extra characters to the fi le’s original 43 character size, an increase of more
than 300 percent. The creators of XML decided that the power of metadata warranted this increase
and, indeed, one of their maxims during the design was that terseness is not an aim, a decision that
many would later come to regret.
Well, if xml is inefficient, then why do we still use it ?
What are the alternatives to xml that also overcome this inefficiency ?
Java Newbie with 72% in OCJP/SCJP - Super Confused Jobless Programmer.
I am a "newbie" too. Please verify my answers before you accept them.
Author and all-around good cowpoke
Joined: Mar 22, 2000
Efficiency in terms of file size is way way way down my list of priorities - here are a few points I like about XML
1. Human readable and editable - makes it possible to create data sets by hand if necessary, easy to test error processing by editing the XML, so so so much easier to explain to another programmer what is going on, you can even annotate with comments.
2. With good design you can add new data types to an existing XML document without having to modify existing programs that use the XML
3. XML can represent quite complex data structures
4. Note that there are efforts to make XML compact - see Fast Infoset
1. Properties file ( name = value, one per line) - fast and compact but only for simple data structures
2. JSON - gaining in popularity, human readable and editable
Also worth bearing in mind that a lot of effort has been put into establishing standard XML-based interchange formats for all kinds of data - office docs, mapping data, financial data, etc etc - specifically to allow different systems to communicate via an accepted neutral format, and these standards are now widely used. So even if I could replace a particular XML standard with a "better" standard using an alternative technology like JSON, I'd still need to persuade all the other people who use the XML standard to do likewise, or I have to support two standards until all the users have made the switch to the new one. That's a lot of work and negotiation for not much benefit. If it ain't (too) broke, don't fix it.
There are lots of good and bad things about the use of XML, and I'm certainly keen to use alternatives whenever they're available, but there is also a lot of "legacy" XML out there (and a lot of inertia) that would have to be dealt with to replace it completely. Still not too convinced by that "human-readable" argument though...