List of utility methods to do XML Escape
String | escape4XML(long study_id, String xmlStr) escape XML if (xmlStr == null) return null; StringBuilder result = new StringBuilder(); StringCharacterIterator sci = new StringCharacterIterator(xmlStr); char c = sci.current(); while (c != CharacterIterator.DONE) { if (c == '<') { result.append("<"); ... |
String | escapeNonXmlTagSymbols(String string) escape Non Xml Tag Symbols StringBuffer result = new StringBuffer(); StringCharacterIterator iterator = new StringCharacterIterator(string); Character character = iterator.current(); while (character != CharacterIterator.DONE) { if (non_xml_pattern.matcher(character.toString()).matches()) result.append(character); character = iterator.next(); return result.toString(); |
String | escapeXML(String s) escape XML final StringBuilder result = new StringBuilder(); final StringCharacterIterator iterator = new StringCharacterIterator(s); char ch = iterator.current(); while (ch != CharacterIterator.DONE) { if (ch == '<') { result.append("<"); } else if (ch == '>') { result.append(">"); ... |