Hello,

I wonder if there is a reason why an extension function written in Java
cannot have a parameter of type DocumentFragment.

What I'm doing is trying to pass an xsl:variable, which has a result tree
fragment in it, to an extension function in java with the signature:

public static NodeSet method(ExpressionContext, Object o,
                             DocumentFragment config);

I then get the error:

java.lang.NoSuchMethodException: For extension function, could not find
method org.apache.xalan.lib.MyClass.method([ExpressionContext,]
#UNKNOWN (java.io.File), #RTREEFRAG).

Changing the signature works:

public static NodeSet method(ExpressionContext, Object o, NodeList config);

But then there is a "not implemented" error because the stree node that
implements the NodeList doesn't implement getLength(). But it does seem to
implement getFirstChild(), so I think it would work if the method could
get the object as a DocumentFragment.


Thanks & regards,
  Erwin


Reply via email to