XML has its uses.
What is the worst abuse of XML that you have seen? What about XML made it so unsuitable for the task?
XML has its uses.
What is the worst abuse of XML that you have seen? What about XML made it so unsuitable for the task?
Storing Images.
Especially as an array of numbers representing individual bytes.
People noting experience with the "XML Programming Language" on their CV. Instant round-file.
Using it as a database, rewriting the file on every update/insert. See this all the time...
On a government project
XML wrapped in XML wrapped in XML wrapped in XML
The data in the original XML was already 8 layers deep.
It always bugs me when I see people using a SAX parser when what they really need is a DOM parser.
There seems to be some sort of standardized XML file format used in Europe for storing bank transactions. I've seen a contest for writing a new XML parser that is able to parse those files (that are > 10 GiB in size) quicker than other approaches. At those file sizes I don't expect XML to be a very good choice of file format.
And another one that bites me regularly here: Some sort of Java object serialisation which seems to work with exactly three different tags: java
, object
and void
. The rest is all done with two or three attributes and massive nesting.
On an inter-department government project where we had to send data to them. They'd heard that xml was the way of the future so they switched over.
They kept saying that our xml wouldn't parse properly. We looked at the data we were producing and it was valid xml, so we asked what the problem was.
Turns out they had written their own parser, which was counting whitespace, and we had too much whitespace in our xml.
Pretty much everything that's written in Java abuses it, or abuses the users by using it as a format for configuration files.
Any sort of configuration file:
What I think is most disturbing about the whole concept of XML is that it is used for configuration when it seems that its focus was more as a data format for parsing documents. I absolutely detest having to write so much of it to configure anything these days. You can probably tell I'm coming at it from a Java background, but when I see examples in YAML, JSON, or even in a DSL, I wish XML hadn't ever become popular before people looked for more serious alternatives. XML is not readable, at least not at all in comparison to these alternatives, and I wish some serious clout was pushed to make XML less dominant.
XMPP is pretty egregious IMHO, because it encodes an entire communication session as a single XML document. As a result, not only are DOM-based APIs useless in implementing XMPP apps (though to some folks, I'm sure that's a feature), but even SAX is problematic in the absence of multi-threading.
I implemented a Jabber client years ago in just such an environment (single-threaded, using SAX APIs); I had to make modifications to the parser to get control back to the application level when the socket returned no more data.
Fontconfig's configuration format. Seriously, who needs to learn some special XML syntax (pretty much a rewrite of XSTL) just to change antialiasing for some font sizes?
XML used to move data from tables in a relational database, into other tables in the same database, in the same application. Some of this data was also stored in text columns, with multiple values combined into a fixed column widths, memo-field style. Multi-valued columns built from multi-valued columns.
Someone else once stated: "XML is like violence. If it does not solve the problem, you are not use enough."
People who knock XML - I think - don't realise how horrific life was before it. Every time you wanted to exchange data, you had to document in excruciating detail how it would be encoded into 80-column text. Usually the first ten columns or so would be metadata.
Then both parties would have to write code for it.
Proper use of XML and schemas is pages and pages of code that you don't have to write, test, and debug.
Beats me why people resent it when it's used to hold config data. It's often a great way to do the job. I think that what's happening here is that the config itself is a pain in the rear, and people are mistakenly thinking that it's XML that's the problem.
What the world needs is a good XML editor that understands schemas and CSS. The main pain relating to XML is having to edit it with a plain txt editor.
Marketing. Thinking that saying "We make Java + XML" is enough to get some paying customers.
Using SOAP to transport an XML document, that has just one node containing encoded data, which when decoded gives you a one-level deep XML of name-value pairs.
Seriously. I've dealt with this in a API I've had to consume.
Writing your own XML parser, a sin of which I've been guilty in the past.
Using XML to describe UIs maybe isn't the worst abuse there is, but it is still pretty bad.
I don't see a point in introducing a new language (and each XML schema is effectively a new language, with specific tags and attributes you'll have to learn), to do the job that, say, plain old Java is quite capable of doing. Furthermore, when coding in Java (or any regular programming language), you have access to standard programming constructs, like if
s and loops, and ability to call methods, create factories for common constructs etc. Along with all other benefits from your IDE like call hierarchy, finding uses of method in workspace etc.
This is applicable, in my opinion, for both desktop and Web environments. For example, in JSP, you start by using XHTML to define your Web page interface... only to realize that you need conditionals and loops after all, and maybe some additional programming logic. So then people add new tags, like c:if, c:forEach
, and an "expression language", so you end up programming in XML, with this awkward constructs, that have to be introduced as "tag libraries". The more I think about it, more awful it looks :)
the XML produced/used by Microsoft Integration Services packages. Hundred/thousand of lines of code - in one single line.
Processing XML with something else than XSLT.
I have seen too many DOM-based spaghetti-like programs that nobody, including their authors can understand.
People will greatly benefit just to know about the identity transformation as a general and most useful design pattern for processing (XML) trees.
Some "developer" doing this (and no, this was NOT the funny joke someone made here about XML, this guy was for real):
<binary>
<byte i="1">123</byte>
<byte i="2">99</byte>
etc...
</binary>
I think I even had a red face from anger when I saw that. People like this should simply get fired instantly.
XAML.
XML is not, and should never be, a programming language.