Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static final String SPACE = " ";
    public static final String QUOTE = "\"";
    public static final String GT = ">";
    public static final String GT_A = ">";
    public static final String LT = "<";
    public static final String LT_A = "&lt;";
    public static final String QUOTE_A = "&quot;";
    public static final String APOS = "'";
    public static final String APOS_A = "&apos;";
    public static final String AND = "&";
    public static final String AND_A = "&amp;";
    public static final String NBSP_A = "&nbsp;";

    public static String decodeXML(final String xML) {

        String result = xML.replaceAll(LT_A, LT);
        result = result.replaceAll(GT_A, GT);
        result = result.replaceAll(QUOTE_A, QUOTE);
        result = result.replaceAll(APOS_A, APOS);
        result = result.replaceAll(AND_A, AND);
        result = result.replaceAll(NBSP_A, SPACE);
        return result;
    }
}