Search code examples
javaxslt-1.0xslt-2.0apache-fop

How to change Apache FOP Xalan XSLT Processor?


I am using Apache FOP 1.1.I want to change current apache Xalan XSLT processor to other for supporting XSLT 2.0. Currently it is not supporting XSLT 2.0. Please help me how to solve this problem. thank you.


Solution

  • I got my Answer. TransformerFactory has a plug-ability layer. JAXP provides a common Java interface that allows flexibilty to add various implementations of the supported standards XSLT processors.

    TransformerFactory tFactory = TransformerFactory.newInstance();
    

    This had look-up procedure to locate XSLT processors.AS we does not defined any,it will take available or default.

    Now, I am adding SAXON XSLT processor . I have added it's .jar file in my project and just added

    TransformerFactory tFactory = TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl",null); 
    

    That's it. now it will use Saxon XSLT processor