summaryrefslogtreecommitdiff
path: root/utils/src/main/java/at/gv/egiz/slbinding
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/main/java/at/gv/egiz/slbinding')
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java9
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java4
2 files changed, 10 insertions, 3 deletions
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<QName> 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<QName> 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