Android examples for XML:XML String Escape
escape XML Attribute Value
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String unescaped = "java2s.com"; System.out.println(escapeAttributeValue(unescaped)); }// w ww .j a v a2s .c o m public static String escapeAttributeValue(String unescaped) { return escapeElementValue(unescaped); // TODO for now } public static String escapeElementValue(String unescaped) { return unescaped.replace("&", "&").replace("<", "<") .replace(">", ">").replace("'", "'") .replace("\"", """); } }