[xsl] Implementing JavaScript

Subject: [xsl] Implementing JavaScript
From: Johannes.Becker@xxxxxx
Date: Thu, 31 Oct 2002 08:42:31 +0100

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="

<xsl:template match="/hallo">


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


<select name="D1" size="1">
  <script language="JavaCcript">
    mon=new Array
    heute= new Date()
    datstring =(heute.getDate()<10)?"0"+heute.getDate():heute.getDate
    document.write("<option>" + datstring + "</option>")



XML-File hello.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="hello1.xsl" type="text/xsl"?>
<hallo title="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.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread