01: package net.sf.saxon.om;
02:
03: /**
04: * The class checks names and characters
05: * against the rules of the XML 1.0 and XML Namespaces 1.0 specification
06: */
07:
08: public final class Name10Checker extends NameChecker {
09:
10: public static final Name10Checker theInstance = new Name10Checker();
11:
12: public static final Name10Checker getInstance() {
13: return theInstance;
14: }
15:
16: /**
17: * Validate whether a given string constitutes a valid NCName, as defined in XML Namespaces.
18: *
19: * @param name the name to be tested
20: * @return true if the name is a lexically-valid NCName
21: */
22:
23: public boolean isValidNCName(String name) {
24: return XMLChar.isValidNCName(name);
25: }
26:
27: /**
28: * Test whether a character is a valid XML character
29: *
30: * @param ch the character to be tested
31: * @return true if this is a valid character in the selected version of XML
32: */
33:
34: public boolean isValidChar(int ch) {
35: return XMLChar.isValid(ch);
36: }
37:
38: /**
39: * Return the XML version supported by this NameChecker
40: *
41: * @return "1.0" as a string
42: */
43:
44: public String getXMLVersion() {
45: return "1.0";
46: }
47: }
48:
49: //
50: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
51: // you may not use this file except in compliance with the License. You may obtain a copy of the
52: // License at http://www.mozilla.org/MPL/
53: //
54: // Software distributed under the License is distributed on an "AS IS" basis,
55: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
56: // See the License for the specific language governing rights and limitations under the License.
57: //
58: // The Original Code is: all this file.
59: //
60: // The Initial Developer of the Original Code is Michael H. Kay.
61: //
62: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
63: //
64: // Contributor(s): none.
65: //
|