public class XMLUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AMP |
static java.lang.String |
APOS |
static java.lang.String |
GT |
static java.lang.String |
LT |
static java.lang.String |
OWL_PROCESSING_INSTRUCTION_NAME |
static java.lang.String |
QUOT |
Constructor and Description |
---|
XMLUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeXML(java.lang.CharSequence s)
Escapes a character sequence so that it is valid XML.
|
static java.lang.String |
getNCNamePrefix(java.lang.CharSequence s)
utility to get the part of a charsequence that is not the NCName fragment
|
static java.lang.String |
getNCNameSuffix(java.lang.CharSequence s)
Get the longest NCName that is a suffix of a character sequence.
|
static int |
getNCNameSuffixIndex(java.lang.CharSequence s)
Gets the index of the longest NCName that is the suffix of a character sequence.
|
static boolean |
hasNCNameSuffix(java.lang.CharSequence s)
Determines if a character sequence has a suffix that is an NCName.
|
static boolean |
isNCName(java.lang.CharSequence s)
Determines if a character sequence is an NCName (Non-Colonised Name).
|
static boolean |
isNCNameChar(int codePoint)
Deterimines if a character is an NCName (Non-Colonised Name) character.
|
static boolean |
isNCNameStartChar(int codePoint)
Deterimines if a character is an NCName (Non-Colonised Name) start character.
|
static boolean |
isQName(java.lang.CharSequence s)
Determines if a character sequence is a QName.
|
static boolean |
isXMLNameChar(int codePoint)
Determines if a character is an XML name character.
|
static boolean |
isXMLNameStartCharacter(int codePoint)
Determines if a character is an XML name start character.
|
public static final java.lang.String LT
public static final java.lang.String GT
public static final java.lang.String QUOT
public static final java.lang.String AMP
public static final java.lang.String APOS
public static final java.lang.String OWL_PROCESSING_INSTRUCTION_NAME
public static boolean isXMLNameStartCharacter(int codePoint)
codePoint
- The code point of the character to be tested. For UTF-16 characters the code point corresponds
to the value of the char that represents the character.true
if codePoint
is an XML name start character, otherwise false
public static boolean isXMLNameChar(int codePoint)
codePoint
- The code point of the character to be tested. For UTF-8 and UTF-16 characters the code point
corresponds to the value of the char that represents the character.true
if codePoint
is an XML name start character, otherwise false
public static boolean isNCNameStartChar(int codePoint)
codePoint
- The code point of the character to be tested. For UTF-8 and UTF-16 characters the code point
corresponds to the value of the char that represents the character.true
if codePoint
is a NCName start character, otherwise false
.public static boolean isNCNameChar(int codePoint)
codePoint
- The code point of the character to be tested. For UTF-8 and UTF-16 characters the code point
corresponds to the value of the char that represents the character.true
if codePoint
is a NCName character, otherwise false
.public static boolean isNCName(java.lang.CharSequence s)
s
- The character sequence to be tested.true
if s
is an NCName, otherwise false
.public static boolean isQName(java.lang.CharSequence s)
s
- The character sequence to be tested.true
if s
is a QName, otherwise false
.public static boolean hasNCNameSuffix(java.lang.CharSequence s)
s
- The character sequence.true
if the character sequence s
has a suffix that is an NCName.public static int getNCNameSuffixIndex(java.lang.CharSequence s)
s
- The character sequence.s
that is an NCName, or
-1 if the character sequence s
does not have a suffix that is an NCName.public static java.lang.String getNCNameSuffix(java.lang.CharSequence s)
s
- The character sequence.s
that is an NCName, or
null
if the character sequence s
does not have a suffix that is an NCName.public static java.lang.String getNCNamePrefix(java.lang.CharSequence s)
s
- the charsequence to splitpublic static java.lang.String escapeXML(java.lang.CharSequence s)
s
- The character sequence.