You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Brandon Sloane (Jira)" <ji...@apache.org> on 2019/11/12 03:12:00 UTC

[jira] [Commented] (DAFFODIL-2232) XML conversion escapes quotes unnecessarily

    [ https://issues.apache.org/jira/browse/DAFFODIL-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16972021#comment-16972021 ] 

Brandon Sloane commented on DAFFODIL-2232:
------------------------------------------

Heads up that Jira seems to convert &amp;quot; to ". To actually have that string displayed, you need to type &amp;amp;quot

> 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: Major
>             Fix For: 2.5.0
>
>
> Users have reported that XML output contains things like
>   
>  <x>foo &amp;quot;bar&amp;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.3.4#803005)