public final class XMLToken extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] name,
boolean lax)
Decodes an NCName to a string.
|
static byte[] |
encode(byte[] name,
boolean lax)
Encodes a string to a valid NCName.
|
static byte[] |
getEntity(byte[] key)
Returns the unicode for the specified entity or
null . |
static boolean |
isChar(int ch)
Checks if the specified character is an XML letter.
|
static boolean |
isName(byte[] value)
Checks if the specified token is a valid name.
|
static boolean |
isNCChar(int ch)
Checks if the specified character is an XML letter.
|
static boolean |
isNCName(byte[] value)
Checks if the specified token is a valid NCName.
|
static boolean |
isNCStartChar(int ch)
Checks if the specified character is a name start character, as required
e.g. by QName and NCName.
|
static boolean |
isNMToken(byte[] value)
Checks if the specified token is a valid NMToken.
|
static boolean |
isQName(byte[] value)
Checks if the specified token is a valid QName.
|
static boolean |
isStartChar(int ch)
Checks if the specified character is an XML first-letter.
|
static boolean |
valid(int ch)
Checks if the specified character is a valid XML 1.0 character.
|
public static boolean valid(int ch)
ch
- the letter to be checkedpublic static boolean isNCStartChar(int ch)
ch
- characterpublic static boolean isNCChar(int ch)
ch
- characterpublic static boolean isStartChar(int ch)
ch
- the letter to be checkedpublic static boolean isChar(int ch)
ch
- the letter to be checkedpublic static boolean isNCName(byte[] value)
value
- value to be checkedpublic static boolean isName(byte[] value)
value
- value to be checkedpublic static boolean isNMToken(byte[] value)
value
- value to be checkedpublic static boolean isQName(byte[] value)
value
- value to be checkedpublic static byte[] encode(byte[] name, boolean lax)
name
- token to be encodedlax
- lax encoding (lossy, but better readable)public static byte[] decode(byte[] name, boolean lax)
name
- namelax
- lax decodingpublic static byte[] getEntity(byte[] key)
null
.key
- keyCopyright © 2005–2015 BaseX Team. All rights reserved.