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

Embedded Javascript (xsl:script issue)

Subject: Embedded Javascript (xsl:script issue)
From: Zeynep Gunal <z.gunal@xxxxxxxxxxxxxxxx>
Date: Tue, 27 Feb 2001 11:03:52 +0100
embedded javascript
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

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.