Here you can find the source of unescape(String text)
Unescapes the provided text with XML entities, see (http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entities_in_XML)
Parameter | Description |
---|---|
text | a parameter |
private static String unescape(String text)
//package com.java2s; /* (c) 2014 Open Source Geospatial Foundation - all rights reserved * (c) 2001 - 2013 OpenPlans/*from w w w .jav a2 s .c o m*/ * This code is licensed under the GPL 2.0 license, available at the root * application directory. */ public class Main { /** * Unescapes the provided text with XML entities, * see (http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entities_in_XML) * @param text * */ private static String unescape(String text) { String s = text; if (s != null && s.matches(".*&(.*);.*")) { s = s.replaceAll(""", "\""); s = s.replaceAll("&", "&"); s = s.replaceAll("'", "'"); s = s.replaceAll("<", "<"); s = s.replaceAll(">", ">"); } return s; } }