in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug
Caused by: javax.xml.stream.XMLStreamException: Attribute not associated with any element
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamWriterImpl.java:610)
at com.sun.xml.internal.stream.writers.XMLEventWriterImpl.add(XMLEventWriterImpl.java:164)
at org.springframework.util.xml.XMLEventStreamWriter.writeAttribute(XMLEventStreamWriter.java:126)
The problem is that the XMLEventStreamWriter implementation seems to think that "writeEmptyElement" means "write element with no attributes", whereas what it really means is "write element with no nested content" (i.e., an element that can be self-closing).
The usage above is explicitly supported by the XMLStreamWriter API and in the JDK implementation results in a self-closing tag being emitted -- with or without attributes.
The fix is to keep track of whether the most recent element is self-closing or not.
in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug
2 participants
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
Archie Cobbs opened SPR-11254 and commented
XMLEventStreamWriter
converts anXMLStreamWriter
into anXMLEventWriter
.However, it fails to handle the following sequence of API calls:
What happens is you get this exception:
The problem is that the
XMLEventStreamWriter
implementation seems to think that "writeEmptyElement" means "write element with no attributes", whereas what it really means is "write element with no nested content" (i.e., an element that can be self-closing).The usage above is explicitly supported by the
XMLStreamWriter
API and in the JDK implementation results in a self-closing tag being emitted -- with or without attributes.The fix is to keep track of whether the most recent element is self-closing or not.
Affects: 3.2.6, 4.0 GA
Attachments:
Backported to: 3.2.7
The text was updated successfully, but these errors were encountered: