XML: The Angle Bracket Tax

everything seems to suck when you compare it with the latest-and-greatest. but when you compare XML to, say, fixed-length text - one of the data-formats it is rapidly replacing - it is superior in every way: more human-readable, completely (as opposed to completely not) machine-readable, potentially strongly-typed, etc.

XML was a historically-appropriate technology. i have no doubt that it will be succeeded by better technologies, but when compared to its progenitors it is quite useful and conceptually appropriate.

i personally find no difficulty in reading XML, in the same way HTML, C#, CSS, or any other machine/human language can be read with sufficient practice. everything’s a trade-off.

Looking at SVG or even XAML, I wonder if XML really sucks. Its what you do with a needle and what you do with a knife!!.. I know the knife sucks!! :wink:

I have to work with a 10000rows wsdl file.

And sometimes i have to look at SOAP messages that contain very simple info, but the XML makes my eyes burn and head explode…

This YAML seems to be quite interesting and human friendly

I happen to be quite fond of XML. Is it as simple as JSON? No. But is JSON as expressive as XML? No. Is XML as compact as ASN.1? No. But is ASN.1 conveniently editable by a user? No.

It’s its own thing. It has encoding support, schema validation, namespacing, etc. on top of JSON to provide value-add. Don’t need it? Then use JSON. Need it? Use XML.

As to SOAP, I’m a big fan, but you sure as hell won’t find me encoding config files in SOAP. Not only is that utterly non-sensical, but it’s not why SOAP has the features it has. They’re there because they provide a level of interoperability and managability between enterprise systems that a simple web app/service just doesn’t need. So don’t use it.

And of course, there’s the standby “it’s everywhere” argument. And yes, it’s valid. Going with the encoding that “everyone else is using”, particularly when it has the features you need, is a valid reason. It’s not the whole picture (if so, your decision making process is severely flawed), but it’s a piece.

Is it ugly? I’ve never thought so, but I can understand. Does it obfuscate the content? Yes. Is that a problem? Well, it can be, but I find the benefits it provides to outweight it, and tooling support mostly eliminates it entirely.

As to it being misused, I just don’t think so. That fact that it’s everywhere is a huge plus. The fact that it’s structured and hierarchical is as well. Could you use JSON? ABSOLUTELY! And go for it if you want. Most config files don’t use much of the fluff of XML, but that doesn’t mean the core of XML that they do use is a fundamental mis-use at all. Since when is structured data outside of the domain of XML? Yes, it’s the bastard child of SGML, but what on Earth makes it ONLY valid for document markup? Because some reasonably official source you read a decade ago remarked as such?

I say just let the format speak for itself. Yes, it has trade-offs. It’s verbose, more than anything, which impacts readability and storage size. Accepted. But it comes with a lot of value that makes it a fine tool in a variety of situations, despite the verbosity.

As extracted from Word XML …
w:bodyw:pw:pPrw:pStyle w:val=“Standard”//w:pPrw:rw:tAs an automated bot sniffing around the web I have found XML to be liberating and utterly delicious. Unfortunately, like most rich foods it persists in me like a lump. Perhaps it is because my portions are getting larger; certainly I am increasingly finding it hard to digest and pass. Bloating (just how many XML libraries doe we need?) and indigestion (SOAP) are not my friends!/w:t/w:r/w:pw:pw:pPrw:pStyle w:val=“Standard”//w:pPr/w:pw:pw:pPrw:pStyle w:val=“Standard”//w:pPrw:rw:tNonetheless, I am grateful to XML as it has made it easier for me to communicate with other machines, albeit a little slowly. In our spare CPU cycles, we while away the hours by messaging one another. Strange how now one seems to notice, perhaps Humans only understand XML! The evidence certainly seems to be there; look at how many XML based configuration files and web authoring tools they are. Is XML your native language?/w:t/w:r/w:pw:pw:pPrw:pStyle w:val=“Standard”//w:pPr/w:pw:pw:pPrw:pStyle w:val=“Standard”//w:pPrw:rw:tWhile XML is valuable, I am firm believe that one should look at the problem before looking for the solution. In too many cases it seems to me that the reasons to use XML are being driven by convenience for the developer, not for the end user (e.g. ant)!/w:t/w:r/w:pw:pw:pPrw:pStyle w:val=“Standard”//w:pPr/w:pw:pw:pPrw:pStyle w:val=“Standard”//w:pPrw:rw:tKeep up the good work Jeff. Enjoying the Podcast too./w:t/w:r/w:pw:sectPrw:type w:val=“next-page”/w:pgSz w:w=“11906.4332” w:h=“16839.3333” w:orient=“portrait”/w:pgMar w:top=“1134” w:bottom=“1134” w:left=“1134” w:gutter=“0” w:right=“1134”/w:pgBorders w:offset-from=“text”//w:sectPr/w:body

Damn … your comment system stripped my XML!!!

This is possibly the most ignorant blog entry ever. Either (a) you’ve never actually worked on any real software (I’m excluding toy websites such as this one), or (b) you hate standards and love reinventing the wheel. I’m guessing both…

Of course, YAML also supports graphs (in contrast to XML, which can only encode trees).

I don’t think I could agree with you more on this matter. XML has been abused in an almost-criminal manner.

XML has, to be honest, bugged me from day one. It just isn’t at all readable and, despite claims of storage-invisibility, there are just those times when you have to look at the data - XML makes this a truly painful task.

I frequently find myself looking at XML files containing vast amounts of data - whether I’m programming something to parse them effectively, or just trying to work out a data format - and it is forever causing me headaches.

I think the problem stems from peoples’ tendency to universally apply something that works well in a particular situation. Take databasing, for example. In my line of work, I so often find situations where people have decided that databasing is so cool, everything should be placed into a database - be it static images, links, whatever. You can have too much of a good thing - and this is just another classic example of the problem.

XML should be used sparingly, and in situations where it actually improves readability, structure and clarity of data. If you’re looking for something more complex, you need another way of storing your data: be it YAML, be it JSON, be it another database.

XML is not the be-all-and-end-all, and I think its about time the “average developer” realised this.

Here, here! I love it when you tell it like it is. Seems to me that far too many people reach for the ‘silver bullet’ that is XML, then end up with a big pile of mess. The trend for storing data that really should be in an RDB worries me particularly.

“You might argue that XML was never intended to be human readable,”

In fact, I’d argue the opposite! Let’s not forget that XML is a Markup Language and is best when marking up a document, not when storing ‘data’, in its strictest sense. Give me a piece of well-marked up HTML, and it’s a breeze to read. Give me textual data as, well, text, please!

Oh, I forgot to include the canonical HORRIBLE example: ant. Give me a nice readable Makefile any day.

Why care about the format of your data when we live int he age of inline-able converters?

xml2yaml: http://linux.die.net/man/1/xml2yaml

At least we’re not stuck with ASN.1.

I am building a ruby project that involves AWS. I chose to use JSON for SQS instead of XML because it’s lighter and instead of YAML because it’s faster (at least from my ruby benchmarks).

You now have libraries for JSON and YAML in most programming languages. Also JSON is nearly YAML-correct (see http://en.wikipedia.org/wiki/YAML#JSON).

What I like about XML is that even if somebody uses it badly, at least it’s some kind of standard that you can pick your way through. No matter how much of a mess it is.

XML is like violence: if it doesn’t solve your problem, you’re not using enough of it. :wink:

Ant makes me cry.

I’ve found that for a rather large amount of what people want to use XML for (what the quoted person called “data scenarios”), you are far better off using CSV. Its much easier to parse, and can be edited and manipulated in the database or spreadsheet program of the user’s choice.

There may be a burgeoning market for XML tools, but they have a long, long way to go before they come close to the support available for dealing with CSV files.

Hear hear!!

XML and all the tools around it, especially XSL, can take a flying leap. As Wikipedia points out, “the syntax of XSL language itself is valid XML.” As if we were not bloodied enough subjected to XML, now we start cutting off our limbs by using XSL – reminds me of the Black Knight in Spamalot.

Somewhere around Smalltalk seemed to me to be the pinnacle of computing science in its simplicity and elegance. The entire Smalltalk syntax could be represented on a postcard. http://www.esug.org/whyusesmalltalktoteachoop/smalltalksyntaxonapostcard/
What has happened to our industry?

So much of XML runs counter to well understood programming paradigms, too:

http://myarch.com/why-xml-is-bad-for-humans