You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2015/07/19 11:02:04 UTC

[jira] [Comment Edited] (LANG-1010) StringEscapeUtils escapeXml escapes already escaped characters

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

Henri Yandell edited comment on LANG-1010 at 7/19/15 9:01 AM:
--------------------------------------------------------------

Thinking out loud, you could create a custom 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.


was (Author: bayard):
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)