On Tue, Feb 18, 2003 at 10:47:06AM -0500, Charles N. Harvey III wrote:
> I would love to see such a package!  Thanks.

I've attached a tarball with some files that add a client-side xsl
version of the friendbook "friends" page.  It works by hooking a
custom shunt factory that decides whether the browser can handle
client-side xsl or not.  If so then it returns XML to the client
otherwise it returns the same HTML that it did before.

The browser detection code comes from the Apache Turbine project
(hacked on by yours truly) and it's probably too conservative - the
only browsers that it will send XML to are IE and Mozilla on Windows.
If people know of other browsers that can handle client-side XSL
transforms then we can modify the shunt.  I think that the license
should be compatible.

The server-side pipeline only has one stage; it adds the processing
instruction to the XML so the browser knows which stylesheet to apply.

On the client side the XSL works a little differently than on the
server side.  Since we only have one XSL transform we can't have one
stylesheet 'wrap' the results of the previous one, but we still want
to separate the page-specific content from the site-wide content.  The
XML points to the page-specific sheet which includes the site-wide
content.  The site-wide sheet matches the root element and then calls
the page-specific template.  Not sure if this is optimal but it works
and the sheets are roughly similar to the server-side sheets.

The tarball contains some Java code that goes into the maverick
project, some content that goes into the opt-domify project, and a
patch for the opt-domify project.  If you have any questions please
ask.

Attachment: friendbook-xsl.tar.gz
Description: Binary data

Reply via email to