owonseed
asked on
Using Javascript in Saxon
Hi,
I'm trying to get the Saxon to use javascript in the XSL. I know this can be achieved in Xalan but I'm having difficulty to get it to work in Saxon. Does it requies BSF and Rhino setup on my local? I have them in my classpath but it is still not working. The following is the code I use. Have anybody done this before? Really appreciate for any suggestion. Thanks!
o.s
===================
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
extension-element-prefixes ="test saxon">
<saxon:script language="javascript" implements-prefix="test" src="com.ibm.bsf.engines.j avascript. JavaScript Engine">
function greetings(user)
{
return "Welcome to xxx " + user;
}
</saxon:script>
<xsl:template match="/">
<xsl:value-of select="test:greetings('Mr . Bean')"/>
</xsl:template>
</xsl:stylesheet>
===================
I'm trying to get the Saxon to use javascript in the XSL. I know this can be achieved in Xalan but I'm having difficulty to get it to work in Saxon. Does it requies BSF and Rhino setup on my local? I have them in my classpath but it is still not working. The following is the code I use. Have anybody done this before? Really appreciate for any suggestion. Thanks!
o.s
===================
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
extension-element-prefixes
<saxon:script language="javascript" implements-prefix="test" src="com.ibm.bsf.engines.j
function greetings(user)
{
return "Welcome to xxx " + user;
}
</saxon:script>
<xsl:template match="/">
<xsl:value-of select="test:greetings('Mr
</xsl:template>
</xsl:stylesheet>
===================
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Gertone,
Thanks for the tips. I've posted a new thread in the Saxon forum. I hope I can get a response from Michael Kay soon.
o.s
Thanks for the tips. I've posted a new thread in the Saxon forum. I hope I can get a response from Michael Kay soon.
o.s
keep us posted here please
cheers
cheers
ASKER
I got the response from Michael Kay:
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3669255
By: mhkay
Javascript is not currently supported and I don't have any plans to do so. It could be done without changes to core Saxon code by writing a new ExtensionBinder, but I'm wary of doing things that involve potential dependencies and installation/configuration complications because they always generate a heavy support and testing load.
--
o.s
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3669255
By: mhkay
Javascript is not currently supported and I don't have any plans to do so. It could be done without changes to core Saxon code by writing a new ExtensionBinder, but I'm wary of doing things that involve potential dependencies and installation/configuration
--
o.s
mmh, that is what I thought.
Thanks for sharing the answer with us
cheers
Thanks for sharing the answer with us
cheers
a reference would have been nice, no?
http://lists.mulberrytech.com/xsl-list/archives/