Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
Problem Summary:
The OMElement.clone() method makes a clone of the current element. However, if the OMElement contains nested XOP:Include nodes, the information (datahandlers, content-ids) are not preserved. In fact, the attachments are lost completely.
Solution:
Currently, the clone() implementation does two things:
(A) Gets a XMLStreamReader to read the events from the source element.
(B) Constructs a StAXOMBuilder to create the new cloned tree.
(A) will be changed to changed to query the source builder. If it is XOPAware, then the XMLStreamReader will be toggled to deliver XOP optimized events.
(B) If the source builder is XOPAware, then an XOPAwareOMBuilder will be created to build the target tree.
This will guarantee that the XOP include information (datahandlers, content-ids) are retained.
I am also including a validation test to verify the new changes.
I will commit the change after some additional testing