Skip to content

Commit

Permalink
set trasformer factory implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Aug 16, 2023
1 parent 96fa5ae commit 52e63c3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ private ByteArrayOutputStream transform(String input, String styles) throws Exce
InputStream styleInputStream = IOUtils.toInputStream(styles, StandardCharsets.UTF_8);
Source stylesource = new StreamSource(styleInputStream);
ByteArrayOutputStream output = new ByteArrayOutputStream();
TransformerFactory transformerFactory = TransformerFactory.newInstance();
TransformerFactory transformerFactory = TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl", null);
Transformer transformer = transformerFactory.newTransformer(stylesource);
if (transformer == null) {
throw new Exception("Failed to initialize transformer. Check styles.");
}
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(inputStream);
Expand Down

0 comments on commit 52e63c3

Please sign in to comment.