«« Next » « Previous
«« Next » « Previous

Link Details

More voters = better DZone links! Login and vote now.
Link 95062 thumbnail

By kbilsted
via firstclassthoughts.co.uk
Published: Jul 15 2008 / 05:51

I was once a believer in XML. Until I started working with it, that is. Now my enthusiasm has faded away - replaced by - well - bitterness or something like that.
  • 26
  • 9
  • 1609
  • 760

Comments

Add your comment
User 131196 avatar

Jakob Jenkov replied ago:

0 votes Vote down Vote up Reply

I don't like XML !

User 285418 avatar

Motion Control replied ago:

0 votes Vote down Vote up Reply

That's your problem. Work on it.

User 131196 avatar

Jakob Jenkov replied ago:

0 votes Vote down Vote up Reply

why should I work on it, when nicer alternatives exist?

User 252611 avatar

Thierry.Lefort replied ago:

0 votes Vote down Vote up Reply

Me neither !

User 201716 avatar

unchqua replied ago:

4 votes Vote down Vote up Reply

Well. Keeping in mind that XML = eXtensible *Markup* Language...

1. Character encoding
If you can edit your file in encoding needed, without broken characters, then you can save it right and definitely can claim appropriate encoding for it. If not, then it's editor problem and you should stay in ASCII boundaries.
Don't overuse CDATA blocks.

2. Embedding binary data
If we can name Base64 method a problem, then I agree with you. For me though it's a simple and fast solution to the problem of storing binary data in XML.

3. Indentation characters mixed with data
"They often have no meaning in the XML data itself." Exactly, and parsing XML file more often than not ignore'em. Then, XML can be viewed in plain text more or less readable, but if you propose some binary format, you'll definitely need a program to display it nicely and just read it somehow.

4. Textual representation of numeric data
Can't disagree, but again, I'm not worrying about file's size, but about numeric and date formats which are, may be, redundant.

5. Unnecessarily verbose
"If data is not hierarchically structured, consider using another less verbose format such a CSV." Exactly. Use XML when it's worth it, and plain flow format otherwise.

6. Human un-readability
Relates to point 3. XML can be indented or compressed. Format specification that mandates to indent hierarchical data will force you to produce larger file which confronts with point 5.

7. A single XML root element
See point 5.

8. SOAP - Oh My God!
Agree.

And in the end, offer an alternative to XML. I know of two: JSON (mostly with all "problems" above) and Binary XML approach (http://en.wikipedia.org/wiki/Binary_XML).

User 246188 avatar

kbilsted replied ago:

0 votes Vote down Vote up Reply

cheers for the long review! I'll read the wiki page and probably link to it if its any good.

User 285418 avatar

Motion Control replied ago:

-1 votes Vote down Vote up Reply

I see 16 reasons why Jakob Jenkov and Kasper Graversen suck!

User 131196 avatar

Jakob Jenkov replied ago:

1 votes Vote down Vote up Reply

haha, nice one Motion Control ... my dad beats your dad...

I've actually argued why I don't think XML is a nice solution. Seriously, in most cases where I have seen XML applied I can think of better alternatives. XML is more like the lowest common denominator than a case of one-solution-solves-all. More of a one-solution-bothers-all.

User 307366 avatar

california_roll replied ago:

1 votes Vote down Vote up Reply

XML is okay, but JSON is better IMHO.
,

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.