Live data from Hacker News

What's frustrating with XML?

stackoverflow.com

11–20 of 28 posts

Re: What's frustrating with XML?

#11
It convinced a generation of framework designers not to bother designing a decent concrete syntax for their domain-specific languages. When the framework is small and/or its developers probably couldn't hire a good language person anyway, this might be for the best, but it's a shame when a huge, well-funded and otherwise fairly well designed beast like WPF/Silverlight/XAML is trapped behind tasteless syntax.

On a deeper level, the element/attribute distinction unnecessarily mucks up the data model, but I'm not sure how big a problem that is in practice.

Re: What's frustrating with XML?

#12
Closed as subjective and argumentative. Darn, I wanted to pick a fight there. ;)

Many of the really crappy aspects of XML have been thoroughly abstracted away by libraries. I'm of the opinion that you can only truly despise XML if you've tried to write a parser for it yourself.

Examples of the issues: It requires arbitrary lookahead & backtracking. There is no canonical document encoding. (Support arbitrary character encoding for content: great idea! Support arbitrary encoding for the metadata/XML itself: The opposite of a great idea.) Entity references: need I say more?

There's a reason this sort of thing keeps coming up: http://voices.washingtonpost.com/securityfix/2009/08/researc...

XML as it would be in an ideal world would be (a) simple and (b) unambiguous; it fails both.

All that said, there's a huge benefit in the whole world arriving at a somewhat standard way of doing things, and a lot of that benefit remains even if the standard itself really sucks.

Re: What's frustrating with XML?

#14
The problem with JSON is that isn't very useful by itself because you always have to encode and decode it, and then analyze the structure to do something with the data. It works better as part of a protocol, not as a native data format.

If you convert your JSON data to XML (assuming it is structured in a way that makes it lossless) you have a whole lot more useful tools at your disposal.

Re: What's frustrating with XML?

#15
The most horrible XML encoding I've encountered recently was the Gnome/Kde Xdg desktop menu system.

Rather than encode what menu item is in what pseudo-folder, it encodes every change made to the menu system as a diff and expects the applications will piece these together -- and the libraries that parse this monstrosity all huffily say "this code is NOT stable...".

http://standards.freedesktop.org/desktop-entry-spec/latest/

Of course, this isn't so much XML's fault as the fault of the folks who kludged together this monstrosity. This shows, however, how XML is more or less a tool for knitting together two or more generally poorly-specified encodings. The good is that these might be somewhat better inside XML than running about wild but the bad is it lets them continue to exist all. See Microsoft's Office XML "standard".

Re: What's frustrating with XML?

#16
post #14

The problem with JSON is that isn't very useful by itself because you always have to encode and decode it, and then analyze the structure to do something with the data. It works better as part of a protocol, not as a native data format. If you convert your JSON data to XML (assuming it is structured in a way that makes it lossless) you have a whole lot more useful tools at your disposal.

People do seem to like abusing attributes... A surprising number of systems seem to rely on embedding entire XML documents in attributes within other documents.

Re: What's frustrating with XML?

#17
post #12

Closed as subjective and argumentative. Darn, I wanted to pick a fight there. ;) Many of the really crappy aspects of XML have been thoroughly abstracted away by libraries. I'm of the opinion that you can only truly despise XML if you've tried to write a parser for it yourself. Examples of the issues: It requires arbitrary lookahead & backtracking. There is no canonical document encoding. (Support arbitrary character…

> I'm of the opinion that you can only truly despise XML if you've tried to write a parser for it yourself.

Or had to work with any of the utterly terrible xml dialects out there, which represents about 90% of them first and foremost xslt and xsd. Or had to deal with the various bugs in parsers, or with most people's (and software's) complete and utter inability to correctly deal with xml namespaces.

Re: What's frustrating with XML?

#18
post #12

Closed as subjective and argumentative. Darn, I wanted to pick a fight there. ;) Many of the really crappy aspects of XML have been thoroughly abstracted away by libraries. I'm of the opinion that you can only truly despise XML if you've tried to write a parser for it yourself. Examples of the issues: It requires arbitrary lookahead & backtracking. There is no canonical document encoding. (Support arbitrary character…

XML isn't bad in and of itself. It's just a powerful, neutral format. The problem with XML is that it allows so much abuse.

I had to interface with a government system at some point. They shipped us a whole schema of custom elements such as "IsShipment" (for example) which extended bool to allow extra options. All this was clearly documented in the schema comments "You can use 'true', 'false', 'sortof', and 'mostly'." So we go to validate the data.... and it doesn't validate. Against their schema. Because they didn't extend bool, they just said they did in the comments. When we got back in touch with them, we realized that they had no clue that the stuff not in comments mattered. As far as they knew, XML was just text, and they had clearly specified how it was to be interpreted (in English).

Re: What's frustrating with XML?

#19
post #12

Closed as subjective and argumentative. Darn, I wanted to pick a fight there. ;) Many of the really crappy aspects of XML have been thoroughly abstracted away by libraries. I'm of the opinion that you can only truly despise XML if you've tried to write a parser for it yourself. Examples of the issues: It requires arbitrary lookahead & backtracking. There is no canonical document encoding. (Support arbitrary character…

XML isn't bad in and of itself. It's just a powerful, neutral format. The problem with XML is that it allows so much abuse. I had to interface with a government system at some point. They shipped us a whole schema of custom elements such as "IsShipment" (for example) which extended bool to allow extra options. All this was clearly documented in the schema comments "You can use 'true', 'false', 'sortof', and 'mostly'.…

You make me wonder if the hate is partly due to XML being used in integration, and integration is difficult and problematic, and vulnerable to all kinds of communication problems.

And if JSON tends to be used where integration isn't very challenging (eg. you control both ends, and the data is fairly regular and simple; or one end is entirely determined by the other); that is, where schemas aren't needed.

Re: What's frustrating with XML?

#20
post #12

Closed as subjective and argumentative. Darn, I wanted to pick a fight there. ;) Many of the really crappy aspects of XML have been thoroughly abstracted away by libraries. I'm of the opinion that you can only truly despise XML if you've tried to write a parser for it yourself. Examples of the issues: It requires arbitrary lookahead & backtracking. There is no canonical document encoding. (Support arbitrary character…

Could you explain the arbitrary lookahead and backtracking please? I thought UPA (unambiguous particle attribution - or "deterministic" for DTDs) avoided the need for backtracking... Or is it to do with entity references? I've found it simple to write XML parsers, but that's for a common (defacto?) subset, not the full spec.
Post reply on HN