When replacingEntityReferences is enabled it may be observed that a few Text in row appears. In theory javax.xml.stream.isCoalescing should control this behavior but unfortunately while setting it to true solves that issue it has some unexpected side effects - namely EntityReferences are not parsed if replacingEntityReferences is set to true. It may seems that we can set isCoalescing only when replacing... is set to true but it will not work as it also causes CData not being parsed. It's described here: https://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/sjsxp/ReleaseNotes.html
To avoid relying on strange behaviors of Java parsers I think xml-lens should provide coalescing functionality by itself. Either as part of parser or as post-processing (same as minimize is done)
When
replacingEntityReferencesis enabled it may be observed that a fewTextin row appears. In theoryjavax.xml.stream.isCoalescingshould control this behavior but unfortunately while setting it totruesolves that issue it has some unexpected side effects - namelyEntityReferencesare not parsed ifreplacingEntityReferencesis set to true. It may seems that we can setisCoalescingonly whenreplacing...is set to true but it will not work as it also causes CData not being parsed. It's described here: https://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/sjsxp/ReleaseNotes.htmlTo avoid relying on strange behaviors of Java parsers I think
xml-lensshould provide coalescing functionality by itself. Either as part of parser or as post-processing (same asminimizeis done)