| java.lang.Object net.sf.saxon.om.NameChecker
All known Subclasses: net.sf.saxon.om.Name10Checker, net.sf.saxon.om.Name11Checker,
NameChecker | abstract public class NameChecker (Code) | | 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.
|
Method Summary | |
final public static String | getPrefix(String qname) Extract the prefix from a QName. | final public String[] | getQNameParts(CharSequence qname) Validate a QName, and return the prefix and local name.
exception: QNameException - if not a valid QName. Parameters: qname - the lexical QName whose parts are required an array of two strings, the prefix and the local name. | abstract public String | getXMLVersion() | final public boolean | isQName(String name) Validate whether a given string constitutes a valid QName, as defined in XML Namespaces. | abstract public boolean | isValidChar(int ch) | abstract public boolean | isValidNCName(String name) Validate whether a given string constitutes a valid NCName, as defined in XML Namespaces. |
getPrefix | final public static String getPrefix(String qname)(Code) | | Extract the prefix from a QName. Note, the QName is assumed to be valid.
Parameters: qname - The lexical QName whose prefix is required the prefix, that is the part before the colon. Returns an emptystring if there is no prefix |
getQNameParts | final public String[] getQNameParts(CharSequence qname) throws QNameException(Code) | | Validate a QName, and return the prefix and local name.
exception: QNameException - if not a valid QName. Parameters: qname - the lexical QName whose parts are required an array of two strings, the prefix and the local name. The firstitem is a zero-length string if there is no prefix. |
getXMLVersion | abstract public String getXMLVersion()(Code) | | Return the XML version supported by this NameChecker
"1.0" or "1.1" as a string |
isQName | final public boolean isQName(String name)(Code) | | Validate whether a given string constitutes a valid QName, as defined in XML Namespaces.
Note that this does not test whether the prefix is actually declared.
Parameters: name - the name to be tested true if the name is a lexically-valid QName |
isValidChar | abstract public boolean isValidChar(int ch)(Code) | | Test whether a character is a valid XML character
Parameters: ch - the character to be tested true if this is a valid character in the selected version of XML |
isValidNCName | abstract public boolean isValidNCName(String name)(Code) | | Validate whether a given string constitutes a valid NCName, as defined in XML Namespaces.
Parameters: name - the name to be tested true if the name is a lexically-valid QName |
|
|