From e91ebb146d9dd4886b918a0a9a25487674b36f4f Mon Sep 17 00:00:00 2001 From: bschnalzer Date: Fri, 24 Mar 2017 07:31:31 +0100 Subject: Update --- .../src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java | 9 ++++++--- utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'utils/src/main/java') diff --git a/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java b/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java index 4bde19b0..7054c973 100644 --- a/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java +++ b/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java @@ -63,8 +63,10 @@ public class RedirectEventFilter implements EventFilter { */ public RedirectEventFilter(OutputStream redirectStream, String encoding) throws XMLStreamException { // , List redirectTriggers - if (redirectStream != null) { - XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + if (redirectStream != null) { + System.setProperty("com.sun.xml.stream.ZephyrWriterFactory", "com.sun.xml.stream.ZephyrWriterFactory"); + XMLOutputFactory outputFactory = XMLOutputFactory.newFactory("com.sun.xml.stream.ZephyrWriterFactory", null); + if (encoding == null) { encoding = DEFAULT_ENCODING; } @@ -205,7 +207,8 @@ public class RedirectEventFilter implements EventFilter { */ public void setRedirectStream(OutputStream redirectStream, String encoding, Set redirectTriggers) throws XMLStreamException { if (redirectStream != null) { - XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + System.setProperty("com.sun.xml.stream.ZephyrWriterFactory", "com.sun.xml.stream.ZephyrWriterFactory"); + XMLOutputFactory outputFactory = XMLOutputFactory.newFactory("com.sun.xml.stream.ZephyrWriterFactory", null); if (encoding == null) { encoding = DEFAULT_ENCODING; } diff --git a/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java b/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java index 70f5dce1..de1b2ddf 100644 --- a/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java +++ b/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java @@ -237,6 +237,10 @@ public class SLUnmarshaller { public Object unmarshal(StreamSource source) throws XMLStreamException, JAXBException { ReportingValidationEventHandler validationEventHandler = new ReportingValidationEventHandler(); +// System.setProperty("javax.xml.stream.XMLInputFactory", "com.sun.xml.stream.ZephyrParserFactory"); +// System.setProperty("com.sun.xml.stream.ZephyrParserFactory", "com.sun.xml.stream.ZephyrParserFactory"); +// XMLInputFactory inputFactory = XMLInputFactory.newInstance("com.sun.xml.stream.ZephyrParserFactory", null); + XMLInputFactory inputFactory = XMLInputFactory.newInstance(); //disallow DTD and external entities -- cgit v1.2.3