Package org.frankframework.util
Class XmlEncodingUtils
java.lang.Object
org.frankframework.util.XmlEncodingUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodeChars(String string) Translates the five reserved XML characters (< > & " ') to their normal selvesstatic StringencodeChars(char[] chars, int offset, int length, boolean escapeNewLines) Translates special characters to xml equivalents like > and &.static StringencodeChars(String string) static StringencodeChars(String string, boolean escapeNewLines) Translates special characters to XML equivalents like > and &.static Stringstatic booleanisPrintableUnicodeChar(int c) static booleanisPrintableUnicodeChar(int c, boolean allowUnicodeSupplementaryCharacters) static Stringstatic StringreadXml(InputStream inputStream, String defaultCharset) Reads binary XML data and uses the XML declaration encoding to turn it into character data.static intreplaceNonPrintableCharacters(char[] buf, int offset, int len) Replaces non-unicode-characters by '0x00BF' (inverted question mark).static StringreplaceNonValidXmlCharacters(String string) Replaces non-unicode-characters by '0x00BF' (inverted question mark) appended with #, the character number and ;.static StringreplaceNonValidXmlCharacters(String string, char to, boolean appendCharNum, boolean allowUnicodeSupplementaryCharacters) static StringstripNonValidXmlCharacters(String string, boolean allowUnicodeSupplementaryCharacters)
-
Field Details
-
REPLACE_NON_XML_CHAR
public static final char REPLACE_NON_XML_CHAR- See Also:
-
-
Method Details
-
encodeChars
-
encodeChars
Translates special characters to XML equivalents like > and &. Please note that non-valid XML chars are not changed, hence you might want to usereplaceNonValidXmlCharacters(String)orstripNonValidXmlCharacters(String, boolean)too. -
encodeCharsAndReplaceNonValidXmlCharacters
-
encodeChars
Translates special characters to xml equivalents like > and &. Please note that non-valid xml chars are not changed, hence you might want to usereplaceNonValidXmlCharacters(String)orstripNonValidXmlCharacters(String, boolean)too. -
decodeChars
Translates the five reserved XML characters (< > & " ') to their normal selves -
replaceNonPrintableCharacters
public static int replaceNonPrintableCharacters(char[] buf, int offset, int len) Replaces non-unicode-characters by '0x00BF' (inverted question mark). -
replaceNonValidXmlCharacters
Replaces non-unicode-characters by '0x00BF' (inverted question mark) appended with #, the character number and ;. -
replaceNonValidXmlCharacters
-
stripNonValidXmlCharacters
-
isPrintableUnicodeChar
public static boolean isPrintableUnicodeChar(int c) -
isPrintableUnicodeChar
public static boolean isPrintableUnicodeChar(int c, boolean allowUnicodeSupplementaryCharacters) -
readXml
Reads binary XML data and uses the XML declaration encoding to turn it into character data.- Throws:
IOException
-
readXml
public static String readXml(byte[] source, String defaultEncoding) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-