/** * @deprecated This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped * HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape * methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library. * Will be removed in 3.0. */ @Deprecated public static void writeXmlEscaped(final String buffer, final Writer writer, final boolean escapeQuotes) throws IOException { if (buffer == null) { return; } writeXmlEscaped(buffer.toCharArray(), writer, escapeQuotes); }
/** * @deprecated This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped * HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape * methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library. * Will be removed in 3.0. */ @Deprecated public static char[] escapeXml(final char[] ch, final boolean escapeQuotes) throws IOException { if (ch == null) { return null; } for (final char c : ch) { if (c == '&' || c == '<' || c == '>' || (escapeQuotes && (c == '\'' || c == '\"'))) { final CharArrayWriter writer = new CharArrayWriter(); writeXmlEscaped(ch, writer, escapeQuotes); return writer.toCharArray(); } } return ch; }
/** * @deprecated This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped * HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape * methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library. * Will be removed in 3.0. */ @Deprecated public static String escapeXml(final String str, final boolean escapeQuotes) throws IOException { if (str == null) { return null; } final int strLen = str.length(); for (int i = 0; i < strLen; i++) { final char c = str.charAt(i); if (c == '&' || c == '<' || c == '>' || (escapeQuotes && (c == '\'' || c == '\"'))) { final StringWriter writer = new StringWriter(); writeXmlEscaped(str, writer, escapeQuotes); return writer.toString(); } } return str; }