diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-07 16:19:55 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-07 16:19:55 +0000 |
commit | a207146c7f52b129da7a11aeda6859ee7c60a262 (patch) | |
tree | 831d6efa859ce9c71e65badc65d6feb010acbb0f /java/sca | |
parent | 27a0279b8532312cb6492e9eb782acd7ccaddb53 (diff) |
Work around http://jira.codehaus.org/browse/WSTX-144
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@802068 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java | 14 |
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 { |