Repository: cxf
Updated Branches:
  refs/heads/master 1026909f9 -> 6d5598ccd


Work around another MOXy bug.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6d5598cc
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6d5598cc
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6d5598cc

Branch: refs/heads/master
Commit: 6d5598ccdc46eaf748d78af092cef88368055410
Parents: 1026909
Author: Daniel Kulp <[email protected]>
Authored: Mon Mar 31 13:34:28 2014 -0400
Committer: Daniel Kulp <[email protected]>
Committed: Mon Mar 31 13:53:45 2014 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/staxutils/CachingXmlEventWriter.java   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6d5598cc/core/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java 
b/core/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
index a5b9b2b..ac18e4c 100644
--- a/core/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
+++ b/core/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
@@ -93,7 +93,15 @@ public class CachingXmlEventWriter implements 
XMLStreamWriter {
     }
 
     public void writeAttribute(String pfx, String uri, String name, String 
value) throws XMLStreamException {
-        addEvent(factory.createAttribute(pfx, uri, name, value));
+        if ("xmlns".equals(pfx)) {
+            if (StringUtils.isEmpty(name)) {
+                writeDefaultNamespace(value);
+            } else {
+                writeNamespace(name, value);
+            }
+        } else {
+            addEvent(factory.createAttribute(pfx, uri, name, value));
+        }
     }
 
     public void writeCData(String arg0) throws XMLStreamException {

Reply via email to