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

Implementing JavaScript

Subject: Implementing JavaScript
From: Johannes.Becker@xxxxxx
Date: Thu, 31 Oct 2002 08:42:31 +0100
implementing javascript
Hi,

I'm having problems implementing JavaScript in my XSL files. Here the code.

XSL-File hello.xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:fo="
http://www.w3.org/1999/XSL/Format">

<xsl:template match="/hallo">

<html>

<head>
<title>
<xsl:value-of select="@title"></xsl:value-of></title>
</head>

<body>

<select name="D1" size="1">
  <script language="JavaCcript">
    <!--
    mon=new Array
("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEPT","OKT","NOV","DEZ")
    heute= new Date()
    datstring =(heute.getDate()<10)?"0"+heute.getDate():heute.getDate
().toString()+"-"+mon[heute.getMonth()]+"-"+heute.getFullYear()
    document.write("<option>" + datstring + "</option>")
    //-->
  </script>
</select>
</body>
</html>


</xsl:template>


</xsl:stylesheet>


XML-File hello.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="hello1.xsl" type="text/xsl"?>
<hallo title="Hallo">
</hallo>


This should put the current date in a select box. Works fine in html, but
not in xml.

What is wrong with my code? Does anyone know a tutorial or whatsoever on
the topic: Javascript in xsl/xml. Haven't really found anything on the net.


Thanks
Jonny


 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.