summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/java/sca/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java b/java/sca/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java
index 8fa91ee8a3..f303e63004 100644
--- a/java/sca/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java
+++ b/java/sca/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java
@@ -32,7 +32,6 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
import org.apache.tuscany.sca.common.xml.dom.DOMHelper;
import org.apache.tuscany.sca.common.xml.stax.impl.StAX2SAXAdapter;
@@ -136,6 +135,10 @@ public class StAXHelper {
}
public Node saveAsNode(XMLStreamReader reader) throws XMLStreamException {
+ // woodstox 3.2.4 fails due to http://jira.codehaus.org/browse/WSTX-144
+ // this issue has been fixed in woodstox 3.2.9
+ // We can use the commented code once we move to woodstox 3.2.9
+ /*
XMLStreamSerializer serializer = new XMLStreamSerializer();
Document document = domHelper.newDocument();
DOMResult result = new DOMResult(document);
@@ -143,6 +146,15 @@ public class StAXHelper {
serializer.serialize(reader, streamWriter);
streamWriter.flush();
return result.getNode();
+ */
+ Document root = domHelper.newDocument();
+ ContentHandler handler = domHelper.createContentHandler(root);
+ try {
+ saveAsSAX(reader, handler);
+ } catch (SAXException e) {
+ throw new XMLStreamException(e);
+ }
+ return root;
}
public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException {