cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [16/21] git commit: Work around another MOXy bug.
Date Wed, 02 Apr 2014 06:26:12 GMT
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/29960cfd
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/29960cfd
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/29960cfd

Branch: refs/heads/2.7.x-fixes
Commit: 29960cfd2accb735f13dadfdde736dc80e157a76
Parents: ff149ae
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon Mar 31 13:34:28 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Apr 2 02:17:49 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/29960cfd/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java b/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
index a5b9b2b..ac18e4c 100644
--- a/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
+++ b/api/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 {


Mime
View raw message