diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org')
-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(); |