[xsl] Embedded Javascript (xsl:script issue)

Subject: [xsl] Embedded Javascript (xsl:script issue)
From: Zeynep Gunal <z.gunal@xxxxxxxxxxxxxxxx>
Date: Tue, 27 Feb 2001 11:03:52 +0100
Hi,

A few days ago I had posted a question about not being able to use
xsl:script, and since this e-mail group discuss quite sophisticated issues
my problem can easily be overlooked. However, I really don't know who to ask
for help!

I need to process a file containing a number of XML messages, translate them
to another HTML-like format and while doing that, generate a unique id for
each of them. One way is using the current date and time, which is what I
intended to do, with an embedded java script. It sounds simple, but I could
not get it to work. "org.xml.sax.SAXException: Instance method call to
method GetDateTime requires an Object instance as first argument" is the
error message I am getting back.

I am copying below the relevant bits of my XSL. I am using Xalan's Xerces
parser and XSLT Processor.

Would anyone have any idea about what I am doing wrong? I would appreciate
any help, even in the form of referral to a help desk, if there is any...

Thanks,

Zeynep



<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.1">
<xsl:output method="html" indent="yes"/>

<xsl:include href="Variables.xsl"/>
<xsl:include href="CharacterConversion.xsl"/>
<xsl:include href="DateConversion.xsl"/>

<xsl:template match="/">
.
.
  <xsl:text disable-output-escaping='yes'>&lt;XID&gt;</xsl:text>
  <xsl:call-template name="get-unique-str"/>
.
.
</xsl:template>

<xsl:template name="get-unique-str">
  <xsl:value-of select="user:GetDateTime()" />
</xsl:template>
 
<xsl:script language="javascript" implements-prefix="user">
  <![CDATA[
  function GetDateTime()
  {
  return "hello";
  }
  ]]>
</xsl:script>

</xsl:stylesheet>


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


Current Thread