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

RE: How I can include javscript code ?

Subject: RE: How I can include javscript code ?
From: "Julian Reschke" <julian.reschke@xxxxxx>
Date: Tue, 9 Jul 2002 21:34:52 +0200
javscript alert
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Vasu Chakkera
> Sent: Tuesday, July 09, 2002 9:24 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  How I can include javscript code ?
>
>
> >Hi I nedd to include some javascript in my XSLT.
> Its not clear as to what you actually want to do..
> If you want to the XSLT processor to execute some javascript,
> then it shud
> be through Extension Element.
> With what you have asked , it looks to  me that you want to just
> have some
> javascript included in the HTML file that your xsl generates.
> for this just include your javascript code in the XSL..
> example
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <script>
> alert('hello');
> </script>
> </xsl:template>
> </xsl:stylesheet>
>
> The above will get an alert box with a hello message
>
> If you want to use some looping logic into the javascript body , then you
> may force yourself to write your code like below..
> <xsl:template match="/">
> <script>
> for(var i = 0;i<3;i++)
> {
> alert('hello');
> }
> </script>
> </xsl:template>
> This however is not correct because you are not allowed to use
> the reserved
> character '<' ( in i<3 )
> In which case your xsl should be as below..
> <xsl:template match="/">
> <script>
> <xsl:text disable-output-escaping="yes">
> ...

Not portable und not necessary. In XHTML, the "<" is *expected* to be
escaped. When producing HTML, the XSLT "html" output method will take care
of this.



 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.