Preserve comments when using JibxMarshaller
Prior to this commit, JibxMarshaller used a SAX ContentHandler to marshal to StAX XMLEventWriters, which inadvertently resulted in the deletion of XML comments. After this commit, JibxMarshaller adapts the XMLEventWriter into an XMLStreamWriter and comments are preserved. Issue: SPR-9768
This commit is contained in:
committed by
Chris Beams
parent
17c6515c0a
commit
f191a55b8f
@@ -338,8 +338,8 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||
|
||||
@Override
|
||||
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) {
|
||||
ContentHandler contentHandler = StaxUtils.createContentHandler(eventWriter);
|
||||
marshalSaxHandlers(graph, contentHandler, null);
|
||||
XMLStreamWriter streamWriter = StaxUtils.createEventStreamWriter(eventWriter);
|
||||
marshalXmlStreamWriter(graph, streamWriter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user