Java Utililty Methods XML Unescape

List of utility methods to do XML Unescape

Description

The list of methods to do XML Unescape are organized into topic(s).

Method

StringunescapedKeyNameXml(final String name)
unescaped Key Name Xml
return name.replace(MARKER, COLON);
StringunescapeForXML(String string)
Given a string, replace all the instances of XML entities with their corresponding XML special characters.
string = substitute(string, "&", "&");
string = substitute(string, """, "\"");
string = substitute(string, "&lt;", "<");
string = substitute(string, "&gt;", ">");
string = substitute(string, "&#10;", "\n");
string = substitute(string, "&#13;", "\r");
return string;
StringunescapeFromXml(String escapedString)
Un-escape a string from its XML encoding - in particular, un-escape &, <, >, ", and hex encoded characters.
StringBuffer string = new StringBuffer();
for (int c = 0; c < escapedString.length();) {
    char ch = escapedString.charAt(c);
    if (ch == '&') {
        if (escapedString.startsWith("amp;", (c + 1))) {
            string.append('&');
            c += 5;
        } else if (escapedString.startsWith("lt;", (c + 1))) {
...
StringunescapeFromXML(String st)
unescape From XML
st = st.replace("&amp;", "&");
st = st.replace("&apos;", "'");
st = st.replace("&lt;", "<");
st = st.replace("&gt;", ">");
st = st.replace("&quot;", "\"");
return st;
StringunescapeFromXML(String string)
Unescapes the String by converting XML escape sequences back into normal characters.
string = replace(string, "&lt;", "<");
string = replace(string, "&gt;", ">");
string = replace(string, "&quot;", "\"");
return replace(string, "&amp;", "&");
StringunescapeFromXML(String string)
unescape From XML
string = replace(string, "&lt;", "<");
string = replace(string, "&gt;", ">");
string = replace(string, "&quot;", "\"");
return replace(string, "&amp;", "&");
StringunescapeFromXML(String string)
Unescapes the String by converting XML escape sequences back into normal characters.
string = replace(string, "&lt;", "<");
string = replace(string, "&gt;", ">");
string = replace(string, "&quot;", "\"");
return replace(string, "&amp;", "&");
StringunescapeFromXML(String string)
Unescapes the String by converting XML escape sequences back into normal characters.
string = replace(string, "&lt;", "<");
string = replace(string, "&gt;", ">");
string = replace(string, "&quot;", "\"");
return replace(string, "&amp;", "&");
StringunescapeXML(final String s)
Unescapes a String, replacing &#nn;, <, >, &, ", and &apos to the corresponding characters.
char[] cc = s.toCharArray();
int len = cc.length;
StringBuffer sb = new StringBuffer();
int pos;
String esc;
for (int i = 0; i < len; i++) {
    int c = cc[i];
    if (c == '&') {
...
StringunescapeXml(String input)
unescape Xml
if (input == null) {
    return null;
return translateAll(input, encoded, decoded_origin);