xsl-list
[Top] [All Lists]

RE: RE: interactive XSLT

2003-05-03 18:20:03
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(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     "Jack Cane" <jwcane(_at_)enw-ltd(_dot_)com>
Sent:     Sat, 3 May 2003 07:44:04 -0400
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  RE: [xsl] interactive XSLT

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

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]On Behalf Of 
Simone Rehm
Sent: Saturday, May 03, 2003 5:23 AM
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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



<Prev in Thread] Current Thread [Next in Thread>