More voters = better DZone links! Login and vote now.
By kbilsted
via firstclassthoughts.co.uk
Published: Jul 15 2008 / 05:51
By kbilsted
via firstclassthoughts.co.uk
Published: Jul 15 2008 / 05:51
Comments
Jakob Jenkov replied ago:
I don't like XML !
Motion Control replied ago:
That's your problem. Work on it.
Jakob Jenkov replied ago:
why should I work on it, when nicer alternatives exist?
Thierry.Lefort replied ago:
Me neither !
unchqua replied ago:
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).
kbilsted replied ago:
cheers for the long review! I'll read the wiki page and probably link to it if its any good.
Motion Control replied ago:
I see 16 reasons why Jakob Jenkov and Kasper Graversen suck!
Jakob Jenkov replied ago:
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.
california_roll replied ago:
XML is okay, but JSON is better IMHO.
,
Voters For This Link (26)
Voters Against This Link (8)