Java XML Unescape unescapeXml(String str)

Here you can find the source of unescapeXml(String str)

Description

unescape Xml

License

LGPL

Declaration

public static String unescapeXml(String str) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String unescapeXml(String str) {
        str = replace(str, """, "\"");
        str = replace(str, "&lt;", "<");
        str = replace(str, "&gt;", ">");
        str = replace(str, "&amp;", "&");
        str = replace(str, "&apos;", "'");
        return str;
    }//from   w w  w.ja  v a2  s.co  m

    protected static String replace(String str, String replace, String replacement) {
        int i = str.indexOf(replace);
        while (i >= 0) {
            str = str.substring(0, i) + replacement + str.substring(i + replace.length());
            i = str.indexOf(replace);
        }
        return str;
    }
}

Related

  1. unescapeXml(String input)
  2. unescapeXML(String s)
  3. unescapeXml(String src)
  4. unescapeXML(String str)
  5. unescapeXml(String str)
  6. unescapeXML(String text)
  7. unescapeXML(String text)
  8. unescapeXml(String value)
  9. unescapeXml(String value)