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

xalan scripting extension setup

Subject: xalan scripting extension setup
From: "I-Lin Kuo" <ikuoikuo@xxxxxxxxxxx>
Date: Tue, 04 Mar 2003 15:45:46 +0000
cocoon xalan extensions
I have xalan running as part of cocoon on Tomcat and I'd like to setup scripting extensions but am having a difficult time setting up javascript extensions according to the instructions on http://xml.apache.org/xalan-j/extensions.html.

The following style sheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:my-ext="ext1"
extension-element-prefixes="my-ext">


<xalan:component prefix="my-ext" functions="dummy">
 <xalan:script lang="javascript">
   function dummy(){
     return "hop to it";
   }
 </xalan:script>
</xalan:component>

<!-- omitted intermediate templates -->

<xsl:template match="sql:categories">
<stuff>
<xsl:value-of select="."/>
<extensions>
<xsl:variable name="today" select="Date:new()" xmlns:Date="xalan://java.util.Date"/>
<xsl:value-of select="$today"/>
<function><xsl:value-of select="my-ext:dummy()"/></function>
</extensions>
</stuff>
</xsl:template>
</xsl:stylesheet>


returns this result:

<?xml version="1.0" encoding="UTF-8" ?>
<content xmlns:xalan="http://xml.apache.org/xalan" xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<stuff>
~15%~1~Male~ ~20%~~Female~ ~11%~~Neither~
<extensions>
Tue Mar 04 10:28:59 EST 2003
<function />
</extensions>
</stuff>
</content>


So the javascript extension doesn't work. I placed the bsf.jar and js.jar files in the tomcat/shared/lib folder and figured that would put it in the classpath. Is that wrong?

I-Lin Kuo, Ann Arbor, MI
Macromedia Certified ColdFusion 5.0 Advanced Developer
Sun Certified Java 2 Programmer
Ann Arbor Java Users Group (http://www.aajug.org)



_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus



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.