XML: Killing the Bloat

Many people criticise XML for being unnecessarily verbose, which is true. What they may not realise is that the bloat can be easily be slimmed down by storing the data in attributes instead of elements.

Example of bloated XML:

The same info can be stored in a much more compact fashion:

slim XML exampleThe slimmed down version has many advantages:

  • Easier to read
  • Faster to load
  • Uses up less disk space and bandwidth

Of coarse, you could achieve the same results by just using JSON, but then you lose out on the XML buzzword ;)

This entry was posted in CodeProject, XML. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Anti-Spam Quiz: