• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Alternatives to XML and why is it still used ?

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic