Description
In some cases, the XMLStreamReader returned by OMContainer#getXMLStreamReader generates a premature END_DOCUMENT event.
This occurs when all of the following conditions are met:
1. Caching is turned off.
2. The subtree contains elements that have the same name as the element on which getXMLStreamReader is invoked (example:. <element><element><element/><element/></element></element>).
3. The subtree is partially built.
The root cause can be traced back to an incorrect fix for AXIOM-151 which introduced the following code in OMStAXWrapper (see r552397):
//this is a potential place for bugs
//we have to test if the root node of this parser
//has the same name for this test
if (currentEvent == START_ELEMENT &&
(parser.getLocalName().equals(((OMElement)rootNode).getLocalName()))) {
++depth;
} else if (currentEvent == END_ELEMENT &&
(parser.getLocalName().equals(((OMElement)rootNode).getLocalName())) ) {
--depth;
if (depth < 0)
}
Attachments
Issue Links
- supercedes
-
AXIOM-151 Body is lost when a SOAPEnvelope which has had headers touched is re-serialized
- Closed