Re: XSL controversy

Subject: Re: XSL controversy
From: "Oren Ben-Kiki" <oren@xxxxxxxxxxxxx>
Date: Sun, 8 Aug 1999 19:26:59 +0200
Sean Mc Grath <digitome@xxxxxx> wrote:
>I guess I should not have mentioned JavaScript as it has confused
>matters. Most of the work is in the recursive algorithm for generating
>interlinked HTML pages to fake the appearance of a collapsible table
>of contents. My head hurts thinking about how this could be done in XSL.


It so happens that we are solving almost the same (sub) problem using
XSL/HTML/JavaScript; we have a database containing a large number of records
with a hierarchical structure and we'd like to display this as a collapsible
tree. In our case the solution was to have the XSLT generate an HTML page
which contained (references to) fixed JavaScript which accessed the database
via an embedded Java applet and inserted elements dynamically into the HTML
DOM - based on HTML "template" fragments produced by the XSLT for the
purpose.

There are advantages to each part of the system - we can change the
formatting of the tree using XSLT, the way we access the database using
Java, the event handling using JavaScript - and the whole thing displays in
a browser. You could say this is exactly the headache you mentioned - but
trying to write this system in any single language would have been far
worse. Using just JavaScript is ludicrous. Using just Java is possible - but
you'd still need some JavaScript to tie it to the browser's event model and
specifying the tree transformations would be a nightmare.

Our system turned out to be quite elegant, in fact - the only messy part is
the JavaScript which like other weakly-typed "anything goes" scripting
languages has a tendency to get out of control when it gets too large. Now,
if browsers used JPython as their preferred scripting languages... but I
digress.

To the point, XSLT is not intended for specifying event handlers, or
database operations (except using XPath for certain form of queries). It is
great for specifying tree to tree conversions - which is what we are using
it for, with good results. Attacking XSLT because you can't write a full
system using it doesn't make much sense.

Share & Enjoy,

    Oren Ben-Kiki


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread