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

RE: EXSLT user-defined function question

Subject: RE: EXSLT user-defined function question
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 28 Nov 2004 23:22:01 -0000
xslt user defined functions
Are you sure than Xalan supports func:function?

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Sanjeeb Basak [mailto:sbasak@xxxxxxxxx] 
> Sent: 28 November 2004 22:46
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  EXSLT user-defined function question
> 
> Hi Geert,
> 
> I'm actually trying to implement the exslt function by xslt, 
> and not by
> java code. I'm wondering if I'm doing some small mistake in the syntax
> of the xslt function implementation, calling of it from the main xslt
> code, the relevant  namespaces, etc.. i'm also trying the 
> exslt function
> the first time :-) 
> 
> Thanks
> Sanjeeb  
> 
> -----Original Message-----
> From: Geert Josten [mailto:Geert.Josten@xxxxxxxxxxx] 
> Sent: Thursday, November 11, 2004 1:50 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  EXSLT user-defined function question
> 
> Hi Sanjeeb,
> 
> I haven't added functions myself, but the most obvious 
> question is: have
> you given you java class the proper package name and have you added it
> to the CLASSPATH of the jvm instance?
> 
> Grtz,
> Geert
> 
> > Hi all,
> > 
> > I'm trying to call an user-defined exslt function, and 
> strangely I get
> 
> > this error. Can somebody quickly suggest something?
> > 
> > Thanks in advance,
> > -Sanjeeb
> > 
> > 
> > Error:
> > } java.lang.RuntimeException: java.lang.NoSuchMethodException: For 
> > extension function, could not find method 
> > org.apache.xalan.lib.ExsltStrings.replace([ExpressionContext,] 
> > #STRING, #STRING, #STRING).
> > 
> > Checked both static and instance methods.
> > 
> >  
> > 
> > My xsl:
> > 
> > <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet 
> > xmlns:date="http://exslt.org/dates-and-times"
> > xmlns:ns="..." xmlns:str="http://exslt.org/strings"
> > xmlns:func="http://exslt.org/functions"
> > xmlns:xalan="http://xml.apache.org/xslt"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > extension-element-prefixes="func date str"
> > str:doc="http://www.exslt.org/str" version="1.0">
> >     <!--$Revision: #2 $-->
> >     <xsl:import href="import-file.xsl"/>
> >     <xsl:output indent="yes" xalan:indent-amount="4"/>
> >     <xsl:template match="/">
> > ...
> > 
> >     <result-tag>	
> > 		<xsl:value-of select="str:replace('ns:field','\r\n','
> > ')"/>
> >     </result-tag>
> > 
> > 
> > Import-file.xsl:
> > 
> > <?xml version="1.0"?>
> > <xsl:stylesheet version="1.0"
> >                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >                 xmlns:str="http://exslt.org/strings"
> >                 xmlns:func="http://exslt.org/functions"
> >                 xmlns:exsl="http://exslt.org/common"
> >                 extension-element-prefixes="str exsl func">
> > 
> > <func:function name="str:replace">
> >    <xsl:param name="string" select="''" />
> >    <xsl:param name="search" select="/.." />
> >    <xsl:param name="replace" select="/.." />
> >    <xsl:choose>
> >       <xsl:when test="not($string)">
> >         <func:result select="/.." />
> >       </xsl:when>
> >       <xsl:when test="function-available('exsl:node-set')">
> > ...

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.