You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Derek Lewis <DL...@cucbc.com> on 2004/02/04 22:26:38 UTC

Extension functions in XSLTC using ExpressionContext

I'm having a heck of a time trying to get my Java extension functions to work in XSLTC, and think I've finally narrowed down why.
It looks to me like Java extension functions, when called from XSLTC, cannot have ExpressionContext as the first argument.  The documentation for Xalan says they can, and I can't find any information stating that this is not the case in XSLTC, but from my testing, and looking at the XSLTC code, it looks like that is the case.

>From org/apache/xalan/xsltc/compiler/FunctionCall.java

if (Modifier.isPublic(mods)
    && methods[i].getName().equals(methodName)
    && methods[i].getParameterTypes().length == nArgs)
{
  ...
}

It seems to only check that the methods have the same number of arguments, not that they have the same OR one extra argument, when the first argument is an ExpressionContext.

My question is this:  Is it even possible for me to modify things such that the behavior will be the same as in regular Xalan?  I'd like to know if there's some reason it's impossible (eg. maybe XSLTC doesn't use ExpressionContext at all) before I attempt it.

Re: Extension functions in XSLTC using ExpressionContext

Posted by Joseph Kesselman <ke...@us.ibm.com>.



I believe that's correct, and ExpressionContext is not available/used in
XSLTC.

What are you trying to do? There might be another way to achieve the same
result...

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk