Java examples for XML:XML Transform
transform Xml To String
// This source code is available under agreement available at //package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String XmlString = "java2s.com"; System.out.println(transformXmlToString(XmlString)); }/*from w w w . ja v a2 s . co m*/ public static String transformXmlToString(String XmlString) { return XmlString .replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ .replaceAll("'", "'"); //$NON-NLS-1$ //$NON-NLS-2$ } }