Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

[deleted]


There are more things wrong with XML than the redundant multi-character closing delimiters. The big problem is the "M" in "XML", which stands for "Markup". The driving metaphor is that you start with a bunch of text, then add tags to mark it up, meaning to indicate what the internal structure is.

The problem with this is that the stuff between the tags is always and only text. There's no notion of a token. In Lisp, 2 and "2" are different things: the first a number, the second a string. In XML, that distinction is not in the file; it's only in the schema.

A version of this problem shows up even in your example. Shouldn't you have written this?

  <set>
    <member>abc</member>
    <member>def</member>
    <member>ghi</member>
  </set>
Ah, you say, but we understand that whitespace around the body of each element is to be ignored. Okay, but where does that information live? I don't even know if that can be stated in the schema; it's up to the app consuming this stuff to know that. Supposing it does -- then, what if I wanted a set containing the string " abc"?

See what I mean? The driving metaphor of "markup" is fundamentally broken. A better metaphor is that of a human-readable serialization format for trees -- such as S-expressions or JSON.

"[T]he problem [XML] solves is not hard, and it does not solve the problem well." -- Siméon and Wadler [0]

[0] http://homepages.inf.ed.ac.uk/wadler/papers/xml-essence/xml-...





Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: