325N/A * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * This class contains static methods used to determine whether identifiers 325N/A * may appear in certain roles in XML documents. Such methods are used 325N/A * both to parse and to create such documents. 325N/A * @author David Brownell 325N/A * @version 1.1, 00/08/05 325N/A * Returns true if the value is a legal XML name. 325N/A * @param value the string being tested 325N/A * Returns true if the value is a legal "unqualified" XML name, as 325N/A * defined in the XML Namespaces proposed recommendation. 325N/A * These are normal XML names, except that they may not contain 325N/A * @param value the string being tested 325N/A * Returns true if the value is a legal "qualified" XML name, as defined 325N/A * in the XML Namespaces proposed recommendation. Qualified names are 325N/A * composed of an optional prefix (an unqualified name), followed by a 325N/A * colon, and a required "local part" (an unqualified name). Prefixes are 325N/A * declared, and correspond to particular URIs which scope the "local 325N/A * part" of the name. (This method cannot check whether the prefix of a 325N/A * name has been declared.) 325N/A * @param value the string being tested 325N/A // [6] QName ::= (Prefix ':')? LocalPart 325N/A // [7] Prefix ::= NCName 325N/A // [8] LocalPart ::= NCName 325N/A // no Prefix, only check LocalPart 325N/A // Prefix exists, check everything 325N/A * This method returns true if the identifier is a "name token" 325N/A * as defined in the XML specification. Like names, these 325N/A * may only contain "name characters"; however, they do not need 325N/A * to have letters as their initial characters. Attribute values 325N/A * defined to be of type NMTOKEN(S) must satisfy this predicate. 325N/A * @param token the string being tested 325N/A * This method returns true if the identifier is a "name token" as 325N/A * defined by the XML Namespaces proposed recommendation. 325N/A * These are like XML "name tokens" but they may not contain the 325N/A * @param token the string being tested