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

XMLBeans does not escape whitespace characters in attribute values on output

    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

          People

            Unassigned Unassigned
            mvanholsteijn Mark van Holsteijn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: