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

RE: XSL transformations with Javascript

Subject: RE: XSL transformations with Javascript
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Mon, 4 Jun 2001 18:04:11 +0100
msxsl script alert
Hi Matt,
Not really questions for this list but here goes.
>
>Hello ALL,
> 
>This question is in three parts, fairly unrelated ... all fall under the
>but I figured to ask them in one message to not annoy those of you, with
>a second message... !
>I apologize, its rather difficult to explain these scenarios clearly,
>hopefully the basics are there, and someone with experience in the
>matter already will pickup on it!
> 
>1.) I try to display status messages while I am doing transformations,
>etc...
>For example...
>   If I run the following script, the "LOADING..." never gets
>displayed...
> 
>   resultDIV.innerHTML = '<TABLE ALIGN="CENTER" BORDER="0"
>HEIGHT="100%"><TR><TD>LOADING...</TD></TR></TABLE>';
>   resultDIV.innerHTML = data.transformNode(ss.XMLDocument);
> 
>   If I place an alert in between these statements, I can see that it
>does change, but just before the transformation replaces it with the
>transformNode()
>      Ultimately I learned that I could call the second statement with a
>settimeout() and that would achieve the desired results.  I feel like
>this is a bit of a hack, and was hoping someone could explain this in
>greater detail, or even explain why!  Does JavaScript run
>asynchronously?

No. While script is executing nothing much else happens. The settimeout allows the window to update the status bar. Try a forever loop and see what doesn't happen.
> 
>2.)   Next I decide to replace the boring text with an animated GIF!  I
>replaced the first line to be:
>      resultDIV.innerHTML = '<TABLE ALIGN="CENTER" BORDER="0"
>HEIGHT="100%"><TR><TD><IMG
>SRC="images/load_data.gif"></TD></TR></TABLE>';
> 
>      Problem: the GIF isn't animated.  If I display the graphic on any
>page in the <HTML> I have no problems, and the graphic is animated...
>but for some reason, if I set the innerHTML of the div, with the
>graphic, it remains at the first layer/frame of the .GIF.
>     Any ideas on how to make my GIF animated again?

Not that I know of. 
> 
>3.)  If I place a <script>alert('something here')</script> in my
>stylesheet, perform a transformation, the script never gets executed...
>is it possible to do this?
> 
No. simple <script elements are just output to the result tree. <msxsl:script elements are executed during transformation but use only the basic language. alert is a method of the window object so isn't available.

Ciao Chris

XML/XSL Portal 
http://www.bayes.co.uk/xml


 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.