camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject camel git commit: CAMEL-10120: Creating an InputStream from XMLStreamReader fails without default namespace
Date Mon, 04 Jul 2016 13:33:56 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 1c2ef2104 -> e517bbd4a


CAMEL-10120: Creating an InputStream from XMLStreamReader fails without default namespace

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

Branch: refs/heads/camel-2.17.x
Commit: e517bbd4a33e878eba998b2c1ec5f28a77dd6c24
Parents: 1c2ef21
Author: Stephan Siano <stephan.siano@sap.com>
Authored: Mon Jul 4 15:10:45 2016 +0200
Committer: Stephan Siano <stephan.siano@sap.com>
Committed: Mon Jul 4 15:33:26 2016 +0200

----------------------------------------------------------------------
 .../camel/converter/jaxp/XMLStreamReaderInputStream.java       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e517bbd4/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java
b/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java
index ab8de5c..9601742 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java
@@ -103,9 +103,9 @@ class XMLStreamReaderInputStream extends InputStream {
                         QName qname = reader.getName();
                         writer.writeStartElement(qname.getPrefix(), qname.getLocalPart(),
qname.getNamespaceURI());
                         for (int i = 0; i < reader.getAttributeCount(); i++) {
-                            writer.writeAttribute(
-                                    reader.getAttributePrefix(i), reader.getAttributeNamespace(i),
reader.getAttributeLocalName(i),
-                                    reader.getAttributeValue(i));
+                            String namespaceUri = reader.getAttributeNamespace(i);
+                            writer.writeAttribute(reader.getAttributePrefix(i), namespaceUri
== null ? "" : namespaceUri, reader.getAttributeLocalName(i),
+                                                  reader.getAttributeValue(i));
                         }
                         for (int i = 0; i < reader.getNamespaceCount(); i++) {
                             writer.writeNamespace(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));


Mime
View raw message