Steve Wampler said:
You're attaching semantics (note the 'should'). There is nothing in
XML that prevents someone from using a unique tag for every entry.
Granted that's not accepted convention (and a bad idea, to boot), but you
have to make some semantic assumptions to get any interpretation out of
XML.
Yes, but that'd be abusing XML in the same sense that there's no reason
why you couldn't "use" CSV in the following manner:
<ExampleCSVDocument>
,,,,,,
,,
,,,,,,,,
,,,,
,,
,
,,,,,,
</ExampleCSVDocument>
Where I'm representing a sequence of integers such that each row (which
is equivalent to a line in CSV) is an integer, and the number of fields
(which is equal to the number of commas plus one) is the value of that
integer. I could represent ASCII (or even Unicode) text that way, but it'd
be breaking the unenforced-but-understood conventions of CSV.
In fact, I could further obfuscate the above document by putting in
random content in between the commas, and defining that you should just
ignore such content, and only count the number of commas.
The difficulty is that there are
too many ways to do so (no standardization) - that's XML's real
contribution, to me - even though it's flawed, it is nearly ubiquitous.
I agree. The great thing about XML is that you can pretty much "accept"
them no matter what platform you're running on (as opposed to, say, a
Microsoft Word document). That's why I sometimes write documents in XHTML,
rather than Microsoft Word, as I want to make it readable by the widest
audience possible.
As to the "too many ways" issue, I've mentioned elsewhere in this thread
the "stack/layer of services" view. TCP/IP can be used for so many
applications: e-mail, file transfer, instant messenging, etc. How can we
make sense of all these uses? Well, the applications don't directly use
TCP/IP, but rather they use services (e.g. FTP) that use TCP/IP. And then
you could built a service on top of FTP to simulate a shared file system,
and so on.
So to me XML is one layer. You can then build layers on top of that
(e.g. XHTML, RSS, SOAP), and then build layers on top of those, and so on.
You can also put XML over other layers (e.g. XML->gzip->FTP->TCP/IP to send
XMLs between computers while still using a reasonable amount of bandwidth).
The fact that it is also (somewhat) self-defining in syntax is also useful
in some contexts, but not something I find *overwhelmingly* valuable.
I like XML's linking to DTDs or XSDs. When you have this strange XML
file, and you think to yourself "Where can I find out more information on
the format?", you have an URL telling you exactly where to go. This is
better, IMHO, than the previous practice of relying on file extensions to
define what kind of data is in the file, and then using a site like
http://filext.com/ to find out more about those kinds of files.
- Oliver