public class XMLUtil extends Object
Constructor and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
escapeAttributeValue(String value)
Escapes all characters that have a special meaning in XML attribute values -- i.e.
|
static String |
escapeCharacterData(String text)
Escapes any special characters in the supplied text so that it can be included as character data in an XML
document.
|
static String |
escapeDoubleQuotedAttValue(String value)
Escapes any special characters in the supplied value so that it can be used as an double-quoted attribute value
in an XML document.
|
static String |
escapeSingleQuotedAttValue(String value)
Escapes any special characters in the supplied value so that it can be used as an single-quoted attribute value
in an XML document.
|
static String |
escapeText(String text)
Escapes all characters that have a special meaning in XML text -- i.e.
|
static int |
findURISplitIndex(String uri)
Tries to find a point in the supplied URI where this URI can be safely split into a namespace part and a local
name.
|
static boolean |
isCombiningChar(char c) |
static boolean |
isDigit(char c) |
static boolean |
isExtender(char c) |
static boolean |
isIdeographic(char c) |
static boolean |
isLetter(char c) |
static boolean |
isNCName(String 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 boolean |
isNCNameChar(char c) |
static boolean |
isNCNameStartChar(char c) |
static boolean |
isValidCharacterDataChar(char c)
Returns whether the specified character can appear in XML character data.
|
static boolean |
isValidCharacterDataChar(int c)
Returns whether the specified character can appear in XML character data.
|
static String |
removeInvalidCharacterDataChars(String s)
Removes all non-valid XML character data chars from the specified String.
|
static String |
resolveEntities(String text)
Replaces all XML character entities with the character they represent.
|
static String |
resolveEntity(String entName)
Resolves an entity reference or character reference to its value.
|
public static String escapeCharacterData(String text)
public static String escapeDoubleQuotedAttValue(String value)
public static String escapeSingleQuotedAttValue(String value)
public static String resolveEntities(String text)
public static String resolveEntity(String entName)
entName
- The 'name' of the reference. This is the string between & and ;, e.g. amp, quot, #65 or #x41.public static int findURISplitIndex(String uri)
uri
- The URI to split.public static final boolean isNCName(String name)
public static final boolean isNCNameStartChar(char c)
public static final boolean isNCNameChar(char c)
public static String escapeAttributeValue(String value)
resolveEntities(java.lang.String)
public static String escapeText(String text)
resolveEntities(java.lang.String)
public static boolean isValidCharacterDataChar(char c)
public static boolean isValidCharacterDataChar(int c)
public static String removeInvalidCharacterDataChars(String s)
public static final boolean isLetter(char c)
public static final boolean isIdeographic(char c)
public static final boolean isCombiningChar(char c)
public static final boolean isDigit(char c)
public static final boolean isExtender(char c)
Copyright © 2015-2019 Eclipse Foundation. All Rights Reserved.