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

RE: XSL Java (&amp;lt; &lt; <) problem

Subject: RE: XSL Java (&amp;lt; &lt; <) problem
From: Rowland Shaw <Rowland.Shaw@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 6 Jan 2004 11:49:02 -0000
lt javascript
> I am curious about xsl, and like it so far. I use it to make from data an
xhtml file with a xsl translation. (so I can change the look/create
different looks without changing my serverpages)
> Ok so I have JavaScript in my XHTML that would make it XDHTML i think...
But when I have:

[snip]

> [ERROR]
> It gives an error cause in javascript i use in the for loop a < sign. ok
but if I change it in &lt; the javascript would go wrong.
> How can I write clear Javascript in XSL without messing up XSL/Java and
getting errors?


Try:

> (XSL)
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript"><![CDATA[
var xmldate = ']]><xsl:value-of
select="/sg/servervariables/variable[@name='servertime']" /><![CDATA[';
function xmld(x,l)
{ var r=""; for(i=x;i<(x+l);i++) { if(xmldate[i]!="0" || r!="")
{r+=xmldate[i];}
  return r;
}
 
var jdate = new Date();
var sdate = new Date(xmldr(0,4), xmldr(4,2)-1, xmldr(6,2), xmldr(8,2), ,
xmldr(10,2), , xmldr(12,2));
var plsmn = "";
alert(sdate);
]]></script>
</head><body>He hallo</body></html>
</xsl:template>
</xsl:stylesheet>

 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.