Author: ruchithf
Date: Thu Oct 19 04:05:07 2006
New Revision: 465573
URL: http://svn.apache.org/viewvc?view=rev&rev=465573
Log:
Make sure we add the default namespace as an attribute when, the parent's
namespace is the same but not the default namespace
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?view=diff&rev=465573&r1=465572&r2=465573
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
Thu Oct 19 04:05:07 2006
@@ -1302,7 +1302,11 @@
// check if the parent of this element has the same namespace
// as the default and if NOT add the attr
- if (this.parentNode != null &&
this.parentNode.getNamespaceURI() != this.getNamespaceURI()) {
+ boolean parentHasSameDefaultNS = this.parentNode != null &&
+ this.parentNode.getNamespaceURI() == this.getNamespaceURI() &&
+ (this.parentNode.getPrefix() == null ||
this.parentNode.getPrefix().equals(""));
+
+ if (!parentHasSameDefaultNS) {
AttrImpl attr = new AttrImpl(this.ownerNode, "xmlns",
this.namespace.getNamespaceURI(), this.factory);
attr.setOMNamespace(new NamespaceImpl(
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]