Package org.frankframework.util
Class XmlEncodingUtils
java.lang.Object
org.frankframework.util.XmlEncodingUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
decodeChars
(String string) Translates the five reserved XML characters (< > & " ') to their normal selvesstatic String
encodeChars
(char[] chars, int offset, int length, boolean escapeNewLines) Translates special characters to xml equivalents like > and &.static String
encodeChars
(String string) static String
encodeChars
(String string, boolean escapeNewLines) Translates special characters to XML equivalents like > and &.static String
static boolean
isPrintableUnicodeChar
(int c) static boolean
isPrintableUnicodeChar
(int c, boolean allowUnicodeSupplementaryCharacters) static String
static String
readXml
(InputStream inputStream, String defaultCharset) Reads binary XML data and uses the XML declaration encoding to turn it into character data.static int
replaceNonPrintableCharacters
(char[] buf, int offset, int len) Replaces non-unicode-characters by '0x00BF' (inverted question mark).static String
replaceNonValidXmlCharacters
(String string) Replaces non-unicode-characters by '0x00BF' (inverted question mark) appended with #, the character number and ;.static String
replaceNonValidXmlCharacters
(String string, char to, boolean appendCharNum, boolean allowUnicodeSupplementaryCharacters) static String
stripNonValidXmlCharacters
(String string, boolean allowUnicodeSupplementaryCharacters)
-
Field Details
-
REPLACE_NON_XML_CHAR
public static final char REPLACE_NON_XML_CHAR- See Also:
-
-
Constructor Details
-
XmlEncodingUtils
public XmlEncodingUtils()
-
-
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
-