You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2014/04/02 08:26:12 UTC
[16/21] git commit: Work around another MOXy bug.
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 <dk...@apache.org>
Authored: Mon Mar 31 13:34:28 2014 -0400
Committer: Daniel Kulp <dk...@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 {