diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-13 14:12:04 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-13 14:12:04 +0000 |
commit | d7c30f1faf71e511af9432d5bc797eb6fbd2465d (patch) | |
tree | 33df5a4549878086981851a7033f6cb74a98df29 /sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache | |
parent | b15df3801cf08b1b6baa7b42cfd2c0429c0cfb4d (diff) |
TUSCANY-3815 - Don't add a namespace twice.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1058574 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java index eecb07e6cd..320db7ab82 100644 --- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java @@ -1173,15 +1173,21 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt writer.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI()); int namespaces = reader.getNamespaceCount(); + boolean elementNamespaceAdded = false; for (int i = 0; i < namespaces; i++) { String prefix = reader.getNamespacePrefix(i); String ns = reader.getNamespaceURI(i); writer.writeNamespace(prefix, ns); + if(ns.equals(name.getNamespaceURI())){ + elementNamespaceAdded = true; + } } - - if (!"".equals(name.getNamespaceURI())) { + + if (!"".equals(name.getNamespaceURI()) && + !elementNamespaceAdded) { writer.writeNamespace(name.getPrefix(), name.getNamespaceURI()); } + // add the attributes for this element namespaces = reader.getAttributeCount(); |