I want to convert XML using XSLT using XALAN. Now I want to use the extension function, this function should be added to the JAVA source, for example, in SAXON:
Method:
TransformerFactory tFactory = TransformerFactory.newInstance(); Configuration c = ((net.sf.saxon.TransformerFactoryImpl) tFactory).getConfiguration(); c.registerExtensionFunction(new FooExtension());
FooExtension:
public class FooExtension extends ExtensionFunctionDefinition { private static final long serialVersionUID = -8143237239412146617L; @Override public SequenceType[] getArgumentTypes() { return new SequenceType[] { SequenceType.EMPTY_SEQUENCE }; } @Override public StructuredQName getFunctionQName() { return new StructuredQName("ns", "http://namespace", "generate-guid"); } }
But how does this work in XALAN (? FunctionTable?,? FunctionResolver?,? URIResolver?), I have to do this by source, I am not allowed to add a class to XSLT.
Thanks!!
source share