Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-357

XMLBeans does not escape whitespace characters in attribute values on output

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Version 2.3
    • None
    • XmlObject
    • None

    Description

      When XMLBeans parses an XML attribute that contains newline character entities, it does preserve them but when the attribute value is sent to output the entity is not preserve causing lose of information.

      An example:

      <document>
      <property name="properties" value="
      line 1
      line 2
      line 3
      "/>
      </document>

      is outputted as

      <document>
      <property name="properties" value="
      line 1
      line 2
      line 3
      "/>
      </document>

      When this document is parsed again, the newlines in the attribute are lost

      Adding the newline character to the saveSubstituteCharacters option using an XmlOptionsCharEscapeMap does not help for attribute values, only for elements.

      Attachments

        1. Saver.java
          120 kB
          Mark van Holsteijn
        2. Saver.java~
          120 kB
          Mark van Holsteijn

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            mvanholsteijn Mark van Holsteijn

            Dates

              Created:
              Updated:

              Issue deployment