cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <>
Subject [jira] Assigned: (CXF-2033) StaxUtils assumes DOM Node::appendChild(c) returns the passed-in child
Date Fri, 13 Feb 2009 03:37:59 GMT


Daniel Kulp reassigned CXF-2033:

    Assignee: Daniel Kulp

> StaxUtils assumes DOM Node::appendChild(c) returns the passed-in child
> ----------------------------------------------------------------------
>                 Key: CXF-2033
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.4
>         Environment: OSX, JBoss AS5, JDK6
>            Reporter: bob mcwhirter
>            Assignee: Daniel Kulp
>   Original Estimate: 0.05h
>  Remaining Estimate: 0.05h
> StaxUtils does XML manipulation:
> in startElement(...) it builds a fragment and attaches it to a parent using appendChild(e):
>         parent.appendChild(e);
> When using this with the JBoss AS5 SOAP/DOM implementation, a SOAPBody appending a SOAPElement
will return a different object than the one passed-in.  (In JBoss's case, you get back a SOAPBodyElement
that's quite similar to, but distinct from, the SOAPElement you passed to appendChild(...)).
> The DOM spec says that appendChild(...) returns the node that was appended, which implies
(to me, and at least 1 other JBoss developer) that it may be different than the one you handed
> This only becomes a problem when later in startElement(...), code calls e.getParent()
to perform some logic.  This fails with JBoss DOM, since the 'e' StaxUtils is holding was
detached from its own parent, and replaced with a different element node.
> The fix is simply to assign the result of appendChild(e) back to e itself:
>     e = (Element) parent.appendChild(e);
> This causes StaxUtils not to freak out the JBoss DOM.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message