Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2232

XML conversion escapes quotes unnecessarily

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.4.0
    • 4.0.0
    • Back End
    • None

    Description

      Users have reported that XML output contains things like
       
      <x>foo &quot;bar&quot; baz</x>
       
      which could just as reasonably be output as:
       
      <x>foo "bar" baz</x>
       
      We should really have an escapeForElementValueIfNeeded routine that returns either the escaped string, or the original string if no escaping was necessary. This would assume you are creating an XML element value, i.e., so no quoting is necessary of quotation marks.
       
      The standard XML library escapify routines don't distinguish escaping for elements from escaping for attributes which is why they always convert quotation marks to entities. We already have to do our own escaping to deal with ASCII NUL so that we can carry that via a PUA remap.
       
      It's also recommended in the XML 1.1 spec, that all the C0 and C1 control characters other than TAB and LF are converted to entities.
       
      DAFFODIL-1559 is our ticket about dealing with the CR, CRLF preservation issue. It suggests CR should be converted to whether alone or in a CRLF pair.
       
      DAFFODIL-919 is also about preserving whitespace generally, and escaping, dealing with CDATA regions.
       
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: