import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
+import net.sf.saxon.dom.DocumentBuilderFactoryImpl;
+
import org.apache.commons.io.output.NullOutputStream;
import org.apache.log4j.Logger;
import org.w3c.dom.Document;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
}
}
- final String ref = FileUtils.readTextFile(fRef, fileEncoding);
if (!this.isCancelled() && (doc != null)) {
if ((pc.getRepositoryImportXsltFile() != null) && (pc.getRepositoryImportXsltFile().length() > 0)) {
Document doc2 = null;
final TransformerFactory tf = FactoryProvider.getTransformerFactory();
final Transformer trans = tf.newTransformer(new StreamSource(xslNomencl));
final DOMResult result = new DOMResult();
- final DOMSource source = new DOMSource(doc);
- trans.transform(source, result);
- doc2 = (Document) result.getNode();
+ final InputStream is = new SequenceInputStream(Collections.enumeration(Arrays.asList(new ByteArrayInputStream(xmlHeader.getBytes()), new FileInputStream(fHeader), new FileInputStream(fRef), new FileInputStream(fFooter))));
+ trans.transform(new StreamSource(is), result);
+ doc2 = (Document) result.getNode();
if (doc2 != null) {
doc = doc2;
}