Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: CG: Semantics, XML, and XQuery



Tom,

As I said in my previous note, there are many good uses
for XML, but I believe that the XML advocates have gone
overboard in making XML syntax a religious issue -- i.e.,
an unquestioned design assumption.

TP> I did not mean to xml-ify Python, C, etc.  I wouldn't
 > advocate that, not by a long shot (I am an enthusiastic
 > Python user, BTW).  I meant, for example, xslt as a very
 > usable xml-based language.  One benefit is that xslt
 > can be used to analyze or query the stylesheet itself,
 > which would not work if xslt syntax were some non-xml
 > syntax invented for xslt purposes.

Liking Python shows good taste, and it's also one of my
favorite programming languages.  I don't want to go into
a detailed critique of XSLT or to propose a completely
redesigned version of XSLT.  But I believe it would be
possible to design a language with exactly the same
semantics as XSLT and exactly the same ability to
define transformations of XML documents, but with
a much simpler syntax.

Since XSLT is a functional language, I wouldn't use
a Python-like syntax, but something more like ML
or Scheme.  There are many obvious simplifications
that would make the language far more compact and
readable without changing the semantics in any way:

  1. Bracket an XSLT program with <script language=XSLT>
     and eliminate the repetitious <xsl> tags.

  2. Replace <xsl:text>...</xsl:text> with just a
     string inside ordinary quotes.

  3. Simplify the <xsl:call-template ...> and all the
     <xsl:param ...> tags to an ordinary function call.

  4. Simplify the for-each and if constructions to the
     equivalents in ML or other functional languages.

  5. Preserve the XML-oriented matching operators,
     but use a simpler notation for invoking them.

The result would be a tree-to-tree transformation
language that is semantically identical to XSLT,
but far more compact and readable.

I would also recommend a similar "dewebification"
of RDF and OWL, which have become too bloated and
verbose because of the attempt to force them into
XML syntax.  Even the human-oriented syntax is far
more complex than it should be -- mainly because it
was designed for a one-to-one mapping to XML form.

For confirmation of that point, just look at what
people are trying to do to make RDF less bloated:

    http://www.fakeroot.net/sw/rdf-formats/#rdf-xml-simple

All these proposals would be vastly simpler if they
just dropped the stupid idea of forcing people to
specify everything in an XML-based notation.

By the way, if anybody complains that getting rid
of the dependence on XML would require a separate
plug-in for each syntax, my response is simple:  the
time to download and install a plug-in is a one-time
charge that is far less than the time to download
every bloated XSLT style sheet (or RDF specification,
OWL specification, etc., etc.).

John Sowa