Java XML Unescape unescapeXmlSymbols(String s1)

Here you can find the source of unescapeXmlSymbols(String s1)

Description

unescape Xml Symbols

License

Open Source License

Declaration

public static String unescapeXmlSymbols(String s1) 

Method Source Code

//package com.java2s;
/*/*from w  ww. j av a2 s. c om*/
 * ConvertUtils.java
 * PROJECT: JDigiDoc
 * DESCRIPTION: Digi Doc functions for creating
 *   and reading signed documents. 
 * AUTHOR:  Veiko Sinivee, S|E|B IT Partner Estonia
 *==================================================
 * Copyright (C) AS Sertifitseerimiskeskus
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * GNU Lesser General Public Licence is available at
 * http://www.gnu.org/copyleft/lesser.html
 *==================================================
 */

public class Main {
    public static String unescapeXmlSymbols(String s1) {
        String s2 = s1.replaceAll("&lt;", "<");
        s2 = s2.replaceAll("&gt;", ">");
        s2 = s2.replaceAll("&gt;", ">");
        s2 = s2.replaceAll("&#xD;", "\r");
        s2 = s2.replaceAll("&apos;", "'");
        s2 = s2.replaceAll("&quot;", "\"");
        s2 = s2.replaceAll("&amp;", "&");
        s2 = s2.replaceAll("&#xA;", "\n");
        return s2;
    }
}

Related

  1. unescapeXMLComment(String content)
  2. unescapeXMLEntities(String text)
  3. unescapeXMLEntity(String str)
  4. unescapeXMLString(String str)
  5. unescapeXMLString2(String str)