Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3493

StaxUtils.copy(XMLStreamReader,XMLStreamWriter) does not preserve empty namespace URIs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.1
    • Component/s: Core
    • Estimated Complexity:
      Novice

      Description

      StaxUtils.copy(XMLStreamReader,XMLStreamWriter) fails to copy documents correctly if they declare a namespace with a zero-length URI. In some cases, this URI is frivolous, but in other cases it is important, such as in the following document:

      <foo xmlns="http://example.com"><bar xmlns=""/></foo>

      StaxUtils will remove this zero-length URI, resulting in the following XML document:

      <foo xmlns="http://example.com"><bar/></foo>

      These two documents are not equivalent. In the first document, bar assumes the "empty namespace". In the second document, "bar" assumes the example.com namespace.

        Attachments

        1. StaxUtilsTest.java
          1 kB
          aaron pieper

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              piepera aaron pieper
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: