You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2014/05/06 13:00:17 UTC

[jira] [Resolved] (LANG-1009) StringEscapeUtils escapeXml escapes already escaped characters

     [ https://issues.apache.org/jira/browse/LANG-1009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-1009.
------------------------

    Resolution: Won't Fix

Sorry, but this is not possible in general.

There's no way of knowing whether (e.g.) "&amp;" has already been escaped or not, since a non-escaped string can contain any character sequence, including the sequence "&amp;".

You could try unescaping followed by escaping, but again, that will cause problems for some input.

The application has to be aware of the context of the input, so it knows whether to escape or not.

> StringEscapeUtils escapeXml escapes already escaped characters
> --------------------------------------------------------------
>
>                 Key: LANG-1009
>                 URL: https://issues.apache.org/jira/browse/LANG-1009
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>    Affects Versions: 3.3
>            Reporter: Kaushal Kumar
>
> StringEscapeUtils escapeXml escapes already escaped characters.
> Is there a way to enhance this API to check if the character is not escaped only then escape the character.



--
This message was sent by Atlassian JIRA
(v6.2#6252)