XML - Practical uses?

Tom Bradford plug-discuss@lists.PLUG.phoenix.az.us
Thu, 21 Jun 2001 13:48:14 -0700


Trent Shipley wrote:
> While there is some truth in this, I think it is overstated.
> 
> First, SGML is less machine friendly than XML, but its complex rules don't
> actually make it human friendly.  The O'Reily Nutshell handbook says that
> several important SGML DTD, including DOCBOOK, are being re-defined, to the
> extent possible, in XML.  In general, there seems to be a consensus emerging
> that one should not do in SGML what can be done in XML.

Notwithstanding whatever quotes can be dug up, SGML is far more human
friendly than XML, and if you want proof of this, ask yourself whether
the world wide web would exist today on the massive scale that it does,
if the underlying language had been based on XML rather than SGML.  It
definitely would not.  I'd actually argue that it would have even gotten
off of the ground.  Humans are inherently lazy, and imposing a format as
strict as XML on them to markup presentation would have been met with
incredible resistant in the 'pre-tools' era of the world wide web. 
Regarding machine friendly...  

You should be clear about the difference between machine friendly and
application friendly.  Granted, both SGML and XML parsers are
non-trivial things to write, but to parse documents in either format
into a machine usable form is fairly straight-foward.  It's the
application layer that suffers in the face of SGML because of the
potential for loose DTD interpretations.  But then, if you're writing a
very flexible DTD, you're inviting the trouble.

> Second, the XML working group saw and evidently sees itself as primarily in
> the business of defining a structural markup language for narrative text,
> not a data structuring language.  The Nutshell book says that the
> applicability of XML to machine data formatting and data transmission is a
> "happy accident".

Tell that to the working groups defining XML Schema, XPath 2, Protocols,
and XQuery.  Though documents may well have been the original intention
of the W3C, that is definitely NOT the focus of the W3C's efforts these
days.

> In fact, XML isn't a replacement for anything.  It is a supplement to SGML.
> Ultimately, XML is about defining subsets of XML (like XHMTL) that are then
> written in the dialect of XML that you just defined.  XML doesn't actually
> *do* anything.  It is just markup.  If you want something interesting to
> happen to an XML document you will need some applications....
> As for programming in XML, there is no reason one couldn't write a DTD that
> would be parsed, then handed to an application that generated machine code,
> or interpreted the parse tree or stream as script instructions.  Again with
> the @#$% Nutshell Handbook, XSLT has been proven to be Turing complete, so
> there already is an XML defined programming language out there, not that I'd
> want to write an operating system kernel using it.

Thanks for basically reiterating what I said with an example.

I own XML in a Nutshell, but I speak from experience.

-- 
Tom Bradford --- The dbXML Project --- http://www.dbxml.org/
We store your XML data a hell of a lot better than /dev/null