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

RE: Dynamically changing and running Javascript after

Subject: RE: Dynamically changing and running Javascript after XSL transform
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Tue, 13 May 2003 15:20:13 -0400
running javascript on the fly
[Kathleen Kappers]
> 
> I do the transformation in the browser - the server does the 
> perl script and
> gives me XML.  Then I want to transform it, but also change 
> some javascript
> and run it instantly, updating the current html page.
> 
> I tried your test and am not getting it called, though.  I 
> tried the onLoad
> call to call a function, too.
> 

The little test example I posted does not need to be called.  If you
make a web page with the example as the only contents, then it will pop
up the alert when the page is loaded.  I tested it before posting and it
worked.  If you cannot get that to happen you need to learn more about
using javascript in a browser before worrying about doing xslt
transformations on the fly.

In what I wrote, I assumed that you already knew how to transform your
xml data in the browser, and could receive the transformed result as a
string.  If so, you would be initiating that transform from a script.
That script could then proceed to do the steps I sketched.

If you do not know how to cause an xsl transformation within the
browser, you need to say so and go looking through FAQs and
documentation for your browser's xml processor (which I assume is
Internet Explorer).  There is some information about it in the list
archives, as well, but of course it is fragmentary.

Here is a sketch of how you might structure your program - you would
have to write all the functions, of course.  It would starts with a call
to run your transform, which would return a string containing javascript
source code.

// Create javascript source code for updating variables
var src = runXSLTtransform(xml,xslt)

// Execute code and update variables
eval(src)

Or you might need to create a data structure which you further process
to update your original values.  Then the eval() would create that data
structure, and you would add a step after the eval -

updateData()

Cheers,

Tom P




 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.