Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Alternatives to XML and why is it still used ?

 
Andy Jack
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read this in a book - beginning xml -
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 ?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Alternatives:

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


Bill



 
chris webster
Bartender
Posts: 2407
32
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic