cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r749584 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
Date Tue, 03 Mar 2009 11:44:48 GMT
Author: bimargulies
Date: Tue Mar  3 11:44:48 2009
New Revision: 749584

URL: http://svn.apache.org/viewvc?rev=749584&view=rev
Log:
More work on CXF-2079. Use W3CDOMStreamWriter to avoid a missing piece of SJSXP. (Namespace
context support for dom sinks.)

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java?rev=749584&r1=749583&r2=749584&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
Tue Mar  3 11:44:48 2009
@@ -32,6 +32,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import org.apache.cxf.helpers.MapNamespaceContext;
 import org.apache.cxf.helpers.XMLUtils;
 
 public class W3CDOMStreamWriter implements XMLStreamWriter {
@@ -132,7 +133,11 @@
         } else {
             currentNode = null;
         }
-        ((W3CNamespaceContext)context).setElement(currentNode);
+        if (context instanceof W3CNamespaceContext) {
+            ((W3CNamespaceContext)context).setElement(currentNode);
+        } else if (context instanceof MapNamespaceContext) {
+            ((MapNamespaceContext) context).setTargetNode(currentNode);
+        }
     }
 
     public void writeEndDocument() throws XMLStreamException {

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java?rev=749584&r1=749583&r2=749584&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
Tue Mar  3 11:44:48 2009
@@ -30,7 +30,6 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMResult;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -59,7 +58,7 @@
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 import org.apache.cxf.test.AbstractCXFTest;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
@@ -300,7 +299,7 @@
     }
 
     protected ElementWriter getElementWriter(Element element, NamespaceContext namespaceContext)
{
-        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(new DOMResult(element));
+        XMLStreamWriter writer = new W3CDOMStreamWriter(element);
         try {
             writer.setNamespaceContext(namespaceContext);
         } catch (XMLStreamException e) {



Mime
View raw message