Explicitly use Saxon instead of Xalan
[gpl/argeo-suite.git] / org.argeo.app.core / src / org / argeo / app / docbook / Dbk4Converter.java
index d3957d9a944e8e85abacdfcfdf17afbcaa2b7d78..f213c02d8efcb294b0f272983a52af6215458c0d 100644 (file)
@@ -23,12 +23,14 @@ import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
-import org.apache.xalan.processor.TransformerFactoryImpl;
 import org.argeo.jcr.JcrException;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
+import net.sf.saxon.BasicTransformerFactory;
+import net.sf.saxon.TransformerFactoryImpl;
+
 /** Convert from DocBook v4 to DocBook v5, using the official XSL. */
 public class Dbk4Converter {
        private final Templates templates;
@@ -36,7 +38,8 @@ public class Dbk4Converter {
        public Dbk4Converter() {
                try (InputStream in = getClass().getResourceAsStream("db4-upgrade.xsl")) {
                        Source xsl = new StreamSource(in);
-                       TransformerFactory transformerFactory = new TransformerFactoryImpl();
+                       TransformerFactory transformerFactory = new BasicTransformerFactory();
+//                     TransformerFactory transformerFactory = new TransformerFactoryImpl();
                        templates = transformerFactory.newTemplates(xsl);
                } catch (IOException | TransformerConfigurationException e) {
                        throw new RuntimeException("Cannot initialise DocBook v4 converter", e);