public abstract class NameChecker extends Object implements Serializable
Constructor and Description |
---|
NameChecker() |
Modifier and Type | Method and Description |
---|---|
String[] |
checkQNameParts(CharSequence qname)
Validate a QName, and return the prefix and local name.
|
int |
firstInvalidChar(CharSequence chars)
Test whether all the characters in a CharSequence are valid XML characters
|
static String |
getPrefix(String qname)
Extract the prefix from a QName.
|
String[] |
getQNameParts(CharSequence qname)
Validate a QName, and return the prefix and local name.
|
abstract String |
getXMLVersion()
Return the XML version supported by this NameChecker
|
abstract boolean |
isNCNameChar(int ch)
Test whether a character can appear in an NCName
|
abstract boolean |
isNCNameStartChar(int ch)
Test whether a character can appear at the start of an NCName
|
boolean |
isQName(String name)
Validate whether a given string constitutes a valid QName, as defined in XML Namespaces.
|
abstract boolean |
isValidChar(int ch)
Test whether a character is a valid XML character
|
boolean |
isValidNCName(CharSequence ncName)
Validate whether a given string constitutes a valid NCName, as defined in XML Namespaces.
|
boolean |
isValidNmtoken(CharSequence nmtoken)
Check to see if a string is a valid Nmtoken according to [7]
in the XML 1.0 Recommendation
|
public final boolean isQName(String name)
name
- the name to be testedpublic static String getPrefix(String qname)
qname
- The lexical QName whose prefix is requiredpublic final String[] getQNameParts(CharSequence qname) throws QNameException
qname
- the lexical QName whose parts are required. Note that leading and trailing
whitespace is not permittedQNameException
- if not a valid QName.public final String[] checkQNameParts(CharSequence qname) throws XPathException
Used from compiled code
qname
- the lexical QName whose parts are required. Note that leading and trailing
whitespace is not permittedXPathException
- if not a valid QName.public final boolean isValidNCName(CharSequence ncName)
ncName
- the name to be tested. Any whitespace trimming must have already been applied.public final boolean isValidNmtoken(CharSequence nmtoken)
nmtoken
- the string to be tested. Any whitespace trimming must have already been applied.public abstract boolean isValidChar(int ch)
ch
- the character to be testedpublic int firstInvalidChar(CharSequence chars)
chars
- the character sequence to be testedpublic abstract boolean isNCNameChar(int ch)
ch
- the character to be testedpublic abstract boolean isNCNameStartChar(int ch)
ch
- the character to be testedpublic abstract String getXMLVersion()
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.