Adding an XPath Function in Xalan 2.7.0 2006-05-29 - By Brian Minchau
Jeroen, although the method org.apache.xpath.compiler.Functiontable.installFunction (String name, Class func) has an array with the name m_functions_customer, I don't think this is a public API. It may be public in the Java sense, but that is probably due to it being using in a different package.
That said, from what I can see from another method in Functiontable used later on to retrieve the XPath functions, that the Class passed in must directly or indirectly extend org.apache.xpath.functions.Function:
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
Is your class extending org.apache.xpath.functions.Function?
- Brian - - - - - - - - - - - - - - - - - - - - Brian Minchau XSLT Development, IBM Toronto e-mail: minchau@(protected)
Jeroen Bulters <jbulters@(protected) .uva.nl> To xalan-j-users@(protected) 05/19/2006 03:24 cc AM Subject Adding an XPath Function in Xalan 2.7.0
Hi,
I'm trying to add an XPath function to Xalan 2.7.0. The function itself compiled without any problems but using org.apache.xpath.compiler.Functiontable.installFunction yields errors I can't come by.
Is the installFunction usable at the moment and if so, can anyone please supply me with a small example of the call?
Thanks in advance.
Jeroen Bulters Informatics Institute, University of Amsterdam Kruislaan 403, 1098SJ Amsterdam M:+31 6 2908 6006
|
|