Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Windows
Description
I have this sample xml part (which is intentionally incorrect, containing duplicate attribute at third level):
<Body>
<Function>
<Parameter attr='a' attr='a'>
<abc/>
</Parameter>
</Function>
</Body>
So I generate an OMElement and try to serialize it using:
String xml="<Body><Function><Parameter attr='a' attr='a'><abc/></Parameter></Function></Body>";
ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
XMLStreamReader parser;
try
catch (XMLStreamException e)
{ // TODO Auto-generated catch block } catch (FactoryConfigurationError e) { // TODO Auto-generated catch block } StAXOMBuilder builder = new StAXOMBuilder(parser);
OMElement bodyElement = builder.getDocumentElement();
bodyElement.serialize(System.out);
... but instead of receiving a duplicate attribute exception (which should probably happen in this case), I get the following output:
<Body>
<Function>
<abc />
</Function>
</Body>
The child element of <Parameter> has become a child element of its parent.
Is this behaviour correct?
Note: This bug may be related to this JIRA: http://issues.apache.org/jira/browse/WSCOMMONS-91. I looked at the AXIOM 1.2.5 source and it seems that the exception is actually thrown inside OMChildrenIterator.next(), but it is caught and a flag is set: isExceptionThrownInAdvancingToNextElement = true.
Attachments
Issue Links
- is related to
-
AXIOM-34 Sometimes accessing an AXIOM tree while the underlying input stream is closed causes an OutOfMemoryError
- Closed