Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9768

JibxMarshaller deletes comments when Result is an XMLEventWriter

    Details

    • Last commented by a User:
      true

      Description

      If a Result created from an XMLEventWriter is passed to a JibxMarshaller for marshalling, then the following happens:

      • AbstractMarshaller.marshal() delegates to AbstractMarshaller.marshalStaxResult()
      • AbstractMarshaller.marshalStaxResult() delegates to JibxMarshaller.marshalXmlEventWriter()
      • JibxMarshaller.marshalXmlEventWriter() creates a ContentHandler from the XMLEventWriter and then proceeds.

      The problem here is that the ContentHandler is a "logical view" API, not a "document view" API and (for example) does not support comments.

      So if you marshal a document containing comments, they are silently deleted.

      This is a bug: it is not appropriate to assume that comments are discardable.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arjen.poutsma Arjen Poutsma
                Reporter:
                archie172 Archie Cobbs
                Last updater:
                Juergen Hoeller
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 39 weeks, 6 days ago