java.lang.Object
org.xbib.content.xml.util.XMLUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequenceescape(char[] chars, int start, int len) static CharSequenceescape(CharSequence string) Replace special characters with XML escapes.static voidescape(StringBuilder sb, char[] chars, int start, int len) static voidescape(StringBuilder sb, CharSequence string) static voidescape(StringBuilder sb, String string) static booleanisCombiningChar(char c) static booleanisDigit(char c) static booleanisExtender(char c) static booleanisIdeographic(char c) static booleanisLetter(char c) static booleanisNCName(CharSequence name) Checks whether the supplied String is an NCName (Namespace Classified Name) as specified at http://www.w3.org/TR/REC-xml-names/#NT-NCName.static booleanisNCNameChar(char c) static Stringsanitize(CharSequence string) Clean strings from illegal XML 1.0 characters.static StringsanitizeToLineFeed(CharSequence string) static StringsanitizeXml10(char[] sequence, int offset, int length) static StringsanitizeXml10(CharSequence sequence) The pattern matching does not work.static StringsanitizeXml11(char[] sequence, int offset, int length) static StringsanitizeXml11(CharSequence sequence) static String
-
Method Details
-
escape
Replace special characters with XML escapes.& (ampersand) is replaced by & < (less than) is replaced by < > (greater than) is replaced by > " (double quote) is replaced by "
- Parameters:
string- The string to be escaped.- Returns:
- The escaped string.
-
escape
-
escape
-
escape
-
escape
-
unescape
-
sanitize
Clean strings from illegal XML 1.0 characters. See XML charset- Parameters:
string- string to clean- Returns:
- the cleaned string
-
sanitizeToLineFeed
-
sanitizeXml10
The pattern matching does not work.- Parameters:
sequence- the character sequence- Returns:
- sanitized string
-
sanitizeXml10
-
sanitizeXml11
-
sanitizeXml11
-
isNCName
Checks whether the supplied String is an NCName (Namespace Classified Name) as specified at http://www.w3.org/TR/REC-xml-names/#NT-NCName.- Parameters:
name- the string- Returns:
- true if string is a namespace classified name
-
isNCNameChar
public static boolean isNCNameChar(char c) -
isLetter
public static boolean isLetter(char c) -
isIdeographic
public static boolean isIdeographic(char c) -
isCombiningChar
public static boolean isCombiningChar(char c) -
isDigit
public static boolean isDigit(char c) -
isExtender
public static boolean isExtender(char c)
-