RE: [xsl] client side style sheets?

Subject: RE: [xsl] client side style sheets?
From: Don Bruey <dbruey@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 1 Feb 2001 10:16:37 -0500
I have missed part of this discussion but be careful about doing
transformations client-side via the browser because you can get into a
situation where your "Back" and "Forward" buttons don't work like they
should.  e.g. If you follow the example that was posted by Jeni, and if what
Jeni suggests works 

1. You load the stylesheet which uses document('data.xml') etc. and
transforms it and displays the results in the browser.  
2. The user does something and you change the data.xml file to set up for
the next transformation by putting in a different @href.  
3. You refresh/load and transformation occurs and the results show up. 
4. Now hit "Back" on the browser.  

What do you see?  I think what you'll see is the same thing you're looking
at when you hit the "Back" button.  Because you're using the browser to
transform your data, "Back" will cause the browser reload your
self-referencing stylesheet, which will load 'data.xml' (which contains your
"current" @href) and you'll get the same data in the browser window.  You
can't go "back" to what you saw before unless you know enough to change the
data.xml file back to what it was.  

I ran into a similar problem but the other way around - have XML sitting out
there and perform multiple client side transformations by replacing the XSL
based on the user's actions and reloading the XML file into the browser
(thus triggering the transformation).  The Back and Forward buttons
exhibited the behavior I described above - the transformation always happens
with your latest XML and XSL files.  

Maybe this behavior isn't a problem in your case - apologies if I've missed
an important aspect of this discussion - if it's not directly applicable to
your situation it's a good warning regardless.  

Don



Paul wrote:

> I am attempting to build a system in which a server generates XML
> data to which the client side then applies an XSLT. I'd like to use
> IE + MSXML3 as the client and have the client- side XSLT generate
> HTML. The server is a very tiny embedded HTTP server that dispatches
> to "response objects" that generate the XML output.

Jeni Wrote:
J> I was wondering whether there might be a way of doing this that
J> used document() to pull in the relevant data from the server.  You
J> could have stylesheets that operated on themselves, and used either a
J> parameter or something hard-coded into a separate document to identify
J> the source that they need.

J> ..example XML and XSL here

J> Opening the stylesheet that they wanted to use to view the data would
J> cause the stylesheet to run on itself (the xml-stylesheet processing
J> instructions can be hardcoded on the stylesheet). The stylesheet would
J> then use the information in the data.xml file to identify which data
J> should be retrieved and formatted, fetch it from the server, and then
J> transform it.


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


Current Thread