|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.om.NameChecker
public abstract class NameChecker
A NameChecker performs validation and analysis of XML names. There are two implementations of this interface, one for XML 1.0 names and one for XML 1.1 names. The class also handles validation of characters against the XML 1.0 or XML 1.1 rules.
Constructor Summary | |
---|---|
NameChecker()
|
Method Summary | |
---|---|
String[] |
checkQNameParts(CharSequence qname)
Validate a QName, and return the prefix and local name. |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NameChecker()
Method Detail |
---|
public final boolean isQName(String name)
name
- the name to be tested
public static String getPrefix(String qname)
qname
- The lexical QName whose prefix is required
public final String[] getQNameParts(CharSequence qname) throws QNameException
qname
- the lexical QName whose parts are required. Note that leading and trailing
whitespace is not permitted
QNameException
- 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 permitted
XPathException
- if not a valid QName.public final boolean isValidNCName(CharSequence ncName)
ncName
- the name to be tested
public final boolean isValidNmtoken(CharSequence nmtoken)
nmtoken
- string to check
public abstract boolean isValidChar(int ch)
ch
- the character to be tested
public abstract boolean isNCNameChar(int ch)
ch
- the character to be tested
public abstract boolean isNCNameStartChar(int ch)
ch
- the character to be tested
public abstract String getXMLVersion()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |