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

RE: creating JavaScript from xsl

Subject: RE: creating JavaScript from xsl
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 19 Nov 2002 13:43:30 -0000
new options javascript
> 
> im creating a *.js (in my case: logic.js) file from an 
> xml/xsl. it is called by an xsl: ... <script 
> type="text/javascript" language="JavaScript" src="logic.js"></
> script>

Use <xsl:output method="text">, and the &lt; character should be output
as "<".

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> ...
> 
> The xsl creating the js:
> ...
> <xsl:template match="/interactive">
> 
> function fillDate()
>            {
>              mon=new Array 
> ("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEPT","OKT",
> "NOV","DEZ");
>              today = new Date();
>              yearString = today.getFullYear();
>              document.createdFrm.yearStart.options[0] = new 
> Option(yearString-1,yearString-1);
>              document.createdFrm.yearStart.options[1] = new 
> Option(yearString,yearString);
>              document.createdFrm.yearStart.options[2] = new 
> Option(yearString+1,yearString+1);
>              document.createdFrm.yearStart.options[1].selected = true;
>              document.createdFrm.yearEnd.options[0] = new 
> Option(yearString-1,yearString-1);
>              document.createdFrm.yearEnd.options[1] = new 
> Option(yearString,yearString);
>              document.createdFrm.yearEnd.options[2] = new 
> Option(yearString+1,yearString+1);
>              document.createdFrm.yearEnd.options[1].selected = true;
> 
>              hallo = new Date();
>              monthString = hallo.getMonth();
>              document.createdFrm.monthStart.options[0] = new 
> Option(mon[monthString-1],monthString);
>              document.createdFrm.monthStart.options[1] = new 
> Option(mon[monthString],monthString+1);
>              document.createdFrm.monthStart.options[2] = new 
> Option(mon[monthString+1],monthString+2);
>              document.createdFrm.monthEnd.options[0] = new 
> Option(mon[monthString-1],monthString);
>              document.createdFrm.monthEnd.options[1] = new 
> Option(mon[monthString],monthString+1);
>              document.createdFrm.monthEnd.options[2] = new 
> Option(mon[monthString+1],monthString+2);
>              
> document.createdFrm.monthStart.options[1].selected = true;
>              document.createdFrm.monthEnd.options[1].selected = true;
> 
>              timeA1 = new Date(yearString, 
> document.createdFrm.monthStart.options[document.createdFrm.mon
> thStart.selectedIndex].value,1);
>              timeDifference1 = timeA1 - 86400000;
>              timeB1 = new Date(timeDifference1);
>              var daysInMonth1 = timeB1.getDate();
> 
>              for (var i = 1; i &lt; 
> document.createdFrm.dayStart.length;
> i++)
>              {
>                document.createdFrm.dayStart.options[0] = null;
>                document.createdFrm.dayEnd.options[0] = null;
>              }
> ....
> 
> Everything works fine except the "<,>" or "&lt;,&gt;". I 
> tried both variations, but none of them worked. If I delete 
> the "<,>" or "&lt;,&gt;" parts the code works fine.
> 
> How can I get the "<,>" or "&lt;,&gt;" to work?
> 
> MfG
> Jonny
> 
> 
> 
> 
>  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.