cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: XSLT/XSP Unification?
Date Tue, 25 Jan 2000 13:35:05 GMT
Scott Boag/CAM/Lotus wrote:

> > The XSP model is more operationally complex, but more intuitive for
> > users:
> >
> >  xml -> transformer -> xsp -> producer -> xml
> >              ^
> >              |
> >          logicsheet
> 
> This seems like simply a more elaborate transformation model.  I don't see
> why the choice of transformation language effects this diagram.
> 
> > 1) performance: the XSP page is compiled, no need for request-time
> > transformation (not true with stylesheet compilation: even if compiled,
> > the transformation processed _must_ take place!)
> 
> I don't see why the use of XSLT in the "XSP" step of your model affects
> this.  Can you elaborate?

Sure.

Since it appears you haven't read (or understood the spec), I'll make it
easy for everybody.

XML is great to contain data, but there was no clear semantics (xsp was
designed in May, before extended-xslt came into existance) on how to
allow dynamic XML generation.

The XSP language defines a semantic you can use to add programmitc logic
to your pages but instead of inventing a turing-complete language using
XML (like the PIA people did), we thought about mixing content and
logic, so, look at this example and try to figure out what it does...
it's pretty easy to follow.

 <xsp:logic>
  int count = Integer.parseInt(request.getParameter("count"));
  for (int i = 0; i != count; i++) {
    <xsp:content>
      <p>Hello, <xsp:expr>request.getRemoteUser()</xsp:expr></p>
    </xsp:content>
  }
 </xsp:logic>

But, as you might note, this breaks the idea of content/logic
separation. This is true, in fact, XSP do not define!!! a way to come up
with the XSP page. It's up to you.

In the Cocoon samples, you have three examples that do the same thing:

1) an hand written XSP page (with content and logic intermixed)
2) a XSLT-based separation (with pure content on one side and pure logic
intermixed with XSLT
3) a taglib based separation (which is almost the same thing, except
that we provide the logicsheets for the tags and you simply have a bunch
of dynamically expanded tags to work with, sort of a lego for dynamic
pages)

But the important part is that an XSP page is the "result" of the
tranformation, not the starting point. Then, the "result" XSP page, is
transformed into java code (using XSLT) and then compiled into a Cocoon
producer, or, in case you want to make it portable without Cocoon, to a
servlet (even if I don't suggest this approach for a number of reasons).

So, the big difference is that XSP is a "final DTD", XSLT is not (well,
you can make it so, but then what's the point?)

Hope this clarifies things.
 
-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message