commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1010) StringEscapeUtils escapeXml escapes already escaped characters
Date Sun, 19 Jul 2015 09:02:04 GMT

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

Henri Yandell commented on LANG-1010:
-------------------------------------

Thinking out loud, you could create a customer translator (subclass of CharSequenceTranslator).
If the letter was an &, you would look ahead to determine if it was a valid escaped character.
If so you would write them out and return the size of what you wrote.

Then you would create an AggregateTranslator around your custom translator and StringEscapeUtils.ESCAPE_XML11.

> StringEscapeUtils escapeXml escapes already escaped characters
> --------------------------------------------------------------
>
>                 Key: LANG-1010
>                 URL: https://issues.apache.org/jira/browse/LANG-1010
>             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.3.4#6332)

Mime
View raw message