[
https://issues.apache.org/jira/browse/DAFFODIL-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olabusayo Kilo updated DAFFODIL-2232:
-------------------------------------
Fix Version/s: (was: 4.0.0)
> XML conversion escapes quotes unnecessarily
> -------------------------------------------
>
> Key: DAFFODIL-2232
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2232
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Affects Versions: 2.4.0
> Reporter: Mike Beckerle
> Priority: Minor
>
> 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.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)