[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: RE: interactive XSLT

Subject: AW: RE: interactive XSLT
From: "Simone Rehm" <simone.rehm@xxxxxx>
Date: Sun, 4 May 2003 21:42:58 +0200
simone rehm
Hello,

Thank you very much for your response.

My first approach was to use Javascript and to access the DOM of the XSLT
stylesheet, modify the parameters and do something like a reload of the
modified XSLT. There is an article "Using the Mozilla JavaScript interface
to XSL Transformations", that describes, how this could be done under the
link
http://www.mozilla.org/projects/xslt/js-interface.html
But the article is not very detailed and I could not get it running.

The XML data, that I am using, are quite huge (measurement results with
several 100 MByte), thus I do not really want to dublicate the whole data,
just to use a different style sheet.
I was hoping I could find a more elegant way to solve this problem. Isnt
this an "every day" problem. I am not too much into stylesheets, but I
expected the basic idea is to view the same data with different style
sheets? And this is exactly what I want to do ...

Simone Rehm

Some responses to below:
-----------------------------------------------------------------
> MY QUESTION:
>  Can I modify parameters (xsl:param) from Javascript based on user
> interaction? How?

>>> IMO, you would first receive user preferences from an HTML form
submission.

YES, that is what I would like to have.
--------------------------------------------------------------------
>  Can I combine one XML document with different style sheets based on user
> interaction (e.g. Javascript)?

>>> Here again, I would use javascript to create a new xml file having the
desired style sheet in its <?xml-stylesheet...> element.

The XML data, that I am using, are quite huge (measurement results with
several 100 MByte), thus I do not really want to dublicate the whole data,
just to use a different style sheet.
I was hoping I could find a more elegant way to solve this problem.
--------------------------------------------------------------------

> The XML should be viewed at our customers. On these Linux PCs mozilla is
> installed as browser. No web server is available.

>>> Not sure what that means. You cannot do any of this without a web
server. Or do you mean that all content resides on the local machine? Then
you must create all the different versions statically and install on the
local machine.

I want to use the Browser just as an intelligent Viewer to show measurement
results.
There is no Web server available. Well, and from Javascript, I can not
create files on the local machine.


-----Ursprüngliche Nachricht-----
Von: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Im Auftrag von
cknell@xxxxxxxxxx
Gesendet: Sonntag, 4. Mai 2003 03:20
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: RE: RE:  interactive XSLT


I don't know of a browser which permits write access to the local file
system which is what you would need to "use javascript to create a new xml
file". It's a basic security issue and the JavaScript versions supported by
browsers just don't have any means of creating a file. I think I remember
that ECMAScript provides create and write access to the file system, but
only from a command line, not from a browser. My conclusion is that Simone
is not going to be able to use the approach described in the original post.

I suppose that if the browser were IE, you could create an instance of the
MSXMLDoc COM object and use its methods for creating a file, but the
specified browser is Mozilla and I suspect that you can't instantiate COM
objects in that context, nor would it be a good idea if you could do so for
security reasons.
--
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     "Jack Cane" <jwcane@xxxxxxxxxxx>
Sent:     Sat, 3 May 2003 07:44:04 -0400
To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  RE:  interactive XSLT

Some thoughts occurred as I read your questions. Perhaps they will help. See
>>> below.

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Simone Rehm
Sent: Saturday, May 03, 2003 5:23 AM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  interactive XSLT


Sorry, if this question is simple for you. But I can not find a good
solution from the Web articles I found.

My problem sound very simple:

I want to display the XML source applying different XSL style sheets
dependent on the user interaction (e.g. buttons) or (preferred) the same
style sheet with different parameter settings. The xml should not be
transformed to html and then displayed, but directly viewed in the browser
( starting first a parser with different parameters would be too much
handling overhead at customer side).

MY QUESTION:
  Can I modify parameters (xsl:param) from Javascript based on user
interaction? How?

>>> IMO, you would first receive user preferences from an HTML form
submission.

>>> Personally I would use Delphi or whatever tool to do the heavy lifting
on the server. More secure and easier (for me) to implement. But I guess you
could do the same with JavaScript on the client. In any case, you "edit" the
old file by the following procedure: Open the old stylesheet. Create a new
text file. Then repeatedly read from the old, write to the new,
changing/adding params or other code as needed. Obviously, you will need to
take care to preserve your original content, as you go about, copying and
renaming files.

  Can I combine one XML document with different style sheets based on user
interaction (e.g. Javascript)?

>>> Here again, I would use javascript to create a new xml file having the
desired style sheet in its <?xml-stylesheet...> element.

>>> There may be a more elegant method, if somehow xml has a way of reading
parameters from an external source (such as the user's response). Or you
could look at rendering the page dynamically using a Web application on the
server, building the xml source on the fly, based upon the user's input.

The XML should be viewed at our customers. On these Linux PCs mozilla is
installed as browser. No web server is available.

>>> Not sure what that means. You cannot do any of this without a web
server. Or do you mean that all content resides on the local machine? Then
you must create all the different versions statically and install on the
local machine.

Thank you very much for a hint, how to go on.

Simone Rehm


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


Tschüss,

jwc



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




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


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.