Sorry, but this change is complete nonsense. There is no such thing as a "composite element" and moving a node never moves its siblings (but only its children). This is actually a bug in the Axiom DOM implementation: the detach() method fails to reset the nextSibling attribute of the node.
Andreas On Thu, Sep 29, 2011 at 13:06, <thilin...@apache.org> wrote: > Author: thilinamb > Date: Thu Sep 29 11:06:11 2011 > New Revision: 1177260 > > URL: http://svn.apache.org/viewvc?rev=1177260&view=rev > Log: > Committing the patch provided by AmilaJ for RAMPART-336. > > Modified: > > axis/axis2/java/rampart/trunk/modules/rampart-core/src/main/java/org/apache/rampart/util/Axis2Util.java > > Modified: > axis/axis2/java/rampart/trunk/modules/rampart-core/src/main/java/org/apache/rampart/util/Axis2Util.java > URL: > http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-core/src/main/java/org/apache/rampart/util/Axis2Util.java?rev=1177260&r1=1177259&r2=1177260&view=diff > ============================================================================== > --- > axis/axis2/java/rampart/trunk/modules/rampart-core/src/main/java/org/apache/rampart/util/Axis2Util.java > (original) > +++ > axis/axis2/java/rampart/trunk/modules/rampart-core/src/main/java/org/apache/rampart/util/Axis2Util.java > Thu Sep 29 11:06:11 2011 > @@ -217,6 +217,10 @@ public class Axis2Util { > // it is a header we have added in rampart eg. > EncryptedHeader and should > // be converted to SOAPHeaderBlock for processing > } else { > + // First detach element from soap header > + element.detach(); > + > + // add new element > header = > soapHeader.addHeaderBlock(element.getLocalName(), element.getNamespace()); > Iterator attrIter = element.getAllAttributes(); > while (attrIter.hasNext()) { > @@ -231,14 +235,17 @@ public class Axis2Util { > // retrieve all child nodes (including any > text nodes) > // and re-attach to header block > Iterator children = element.getChildren(); > - while (children.hasNext()) { > + > + // Element is a composite element, in which it > has many siblings. > + // All siblings will be added when we add a > single node. > + // See ParentNode.insertBefore(Node newChild, > Node refChild) for > + // more information. > + if (children.hasNext()) { > OMNode child = (OMNode)children.next(); > children.remove(); > header.addChild(child); > } > - > - element.detach(); > - > + > soapHeader.build(); > > header.setProcessed(); > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org For additional commands, e-mail: java-dev-h...@axis.apache.org