|
 |
Warp wrote:
> Darren New <dne### [at] san rr com> wrote:
>> He makes a good point that
>> <integer>0</integer>
>> is a dumb-ass way of encoding data. :-)
>
> I never understood why the closing tag must be named. What's the point?
The point is to make it easy to check the data is formatted correctly.
In SGML, you could omit the closing tags when it wasn't ambiguous. If your
DTD said paragraphs cannot nest inside paragraphs, you could write
<p> first paragraph <p> second paragraph <p> third paragraph <section> next
just like you could in the very first versions of HTML.
XML tried to "simplify" it, but of course they simplified it for the writer
of the XML parser, rather than for the author of the XML data. SGML also
required a DTD, while XML can be parsed without.
Of course, you could just have </> mean "close the most recent tag that
hasn't been closed", and then you're really close to having s-expr's. ;-)
> I have always felt that XML is schizophrenic: It tries to be "human-
> readable", but at the same time it's *really* intended only for programs
> to read and generate. So it's trying to appeal to two completely different
> targets, and the result is a bloated mess.
Yep.
I see a lot of arguments that it's unnecessary to have both attributes and
nested CDATA. This argument, however, only comes from people who don't use
XML for markup. CDATA is the prose in your document. Attributes aren't. It's
pretty straightforward if you're using it for markup. If you're using it as
a wrapper for SOAP, then it doesn't make sense to have both attributes and
CDATA, but then it doesn't make sense to use XML to start with in that case.
> And rather unnecessarily at that, IMO. If they had done it with similar
> principles to LaTeX, it would have been human-readable, human-writable and
> relatively compact, all at the same time. Sure, it would have made XML parsers
> more complicated, but that's what programs are for: To ease the burden of
> people.
Agreed. Or, if they wanted a data transfer language like for SOAP or
whatever, use ASN.1. It's already standardized, easy to read, write, and
verify, and has both human-readable and compact and time-efficient
representations.
--
Darren New, San Diego CA, USA (PST)
Insanity is a small city on the western
border of the State of Mind.
Post a reply to this message
|
 |