Re: XML: The good, the bad, and the ugly

From: Marshall Spight <mspight_at_dnai.com>
Date: Mon, 18 Oct 2004 06:18:12 GMT
Message-ID: <DeJcd.259960$MQ5.105742_at_attbi_s52>


"Lemming" <thiswillbounce_at_bumblbee.demon.co.uk> wrote in message news:7mv5n0hes3aan2dkg426ec76a91dhgcknf_at_4ax.com...
> On Sun, 17 Oct 2004 23:03:01 GMT, "Marshall Spight" <mspight_at_dnai.com>
> wrote:
> >
> >"It's only there because of the hardware" applies to every file format
> >ever, including XML. As a statement, it's a no-op.
>
> I'm not sure I agree, although I am finding it difficult to put my
> reasons into words.
>
> Binary is not a file format. I'm aware that a chip designer may well
> see things differently but from the perspective of software the on/off
> switches which make up the computer's memory is the bricks and mortar
> from which we build everything else. Binary representation is an
> unavoidable limitation imposed upon us by this hardware. To use a
> different system, we would need new hardware.

Yes, but this doesn't matter a whit. If your hardware used decimal digits, your source code would look pretty much exactly the same. And you'd still have the same dichotomy, between the native decimal representation of integers and the string-encoded representation.

> XML, or any other file format, is not constrained by the hardware
> (beyond the fact that it is stored upon the hardware).

Of course it is. It's just encoding data in strings, is the only difference.

> XML is a
> conceptual solution to a logical problem.

XML is no more conceptual than JPEG or s-expressions or the Java serialization format or CSV.

> >> It is a Jack of All Trades.
> >
> >Yes, it's bad at everything (except possibly marking up text with presentation.)
>
> Semantics, surely? The presentation of the data comes elsewhere.

Yes, semantics is one of the things it's really bad at.

It has no way of expressing constraints, or data types, and the only relationship it can express is containment. (For example, in HTML, a <li> is contained within a <ul>.) Containment is not sufficiently general to express arbitrary data structures without the addition of some reference type, which XML doesn't have.

> >> It is strong at providing data in a
> >> standard format readable by a wide variety of different systems.
> >
> >It's no better at this than any other format. Just because many
> >computers already have 500k XML parsers installed doesn't
> >mean the format is easy to parse.
>
> I've never tried to write an XML parser, but I've thought about it.
> It seems to me that it should be reasonably easy to write a
> non-validating parser as long as the language supports recursion.

Here's a BNF for XML. It is not simple; it has a lot of productions for something that is supposed to be small, clean, and generic.

http://xml.coverpages.org/xmlBNF.html

> >It isn't typed, for crying out loud! It doesn't
> >have schemata!
>
> This statement goes over my head. I thought the point of XML Schema
> was to provide type information as well as structure.

DTDs and XMLSchema are both attempts to retrofit a schema mechanism onto XML. This should frighten you, because it means that they didn't even know enough about data management when they started to consider schema handling as a first-class job. Also appalling, and simultaneously hilarious, is that there first attempt, DTD, wasn't even an XML format! That's right; they have this supposedly *universal* meta-format, and the first instant they need to expand it, they don't even use their own format; they invent a totally new one! And of course, they did the same thing again for CSS; when they needed a way to try to extract presentation elements from HTML, which had been mixed in before, they invented *another* totally new file format. This demonstrates that they are incompetent even in their supposed area of strength, markup.

The w3c has set data management back 25 years, and UI design back 15 years. Their incompetence will ultimately end up costing the human race *billions* of dollars, because so many people are following them. This is not a popular opinion, but there you are.

Marshall Received on Mon Oct 18 2004 - 08:18:12 CEST

Original text of this message