Coverage Report - org.jaxen.saxpath.base.Verifier
 
Classes in this File Line Coverage Branch Coverage Complexity
Verifier
63%
212/334
64%
211/329
188.667
 
 1  
 /*-- 
 2  
  *
 3  
  * $Id$
 4  
  *
 5  
  * Copyright 2000-2004 Jason Hunter & Brett McLaughlin.
 6  
  * All rights reserved.
 7  
  *
 8  
  * Redistribution and use in source and binary forms, with or without
 9  
  * modification, are permitted provided that the following conditions are
 10  
  * met:
 11  
  * 
 12  
  *   * Redistributions of source code must retain the above copyright
 13  
  *     notice, this list of conditions and the following disclaimer.
 14  
  * 
 15  
  *   * Redistributions in binary form must reproduce the above copyright
 16  
  *     notice, this list of conditions and the following disclaimer in the
 17  
  *     documentation and/or other materials provided with the distribution.
 18  
  * 
 19  
  *   * Neither the name of the Jaxen Project nor the names of its
 20  
  *     contributors may be used to endorse or promote products derived 
 21  
  *     from this software without specific prior written permission.
 22  
  * 
 23  
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 24  
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 25  
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 26  
  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
 27  
  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 28  
  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 29  
  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 30  
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 31  
  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 32  
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 33  
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 34  
  *
 35  
  * ====================================================================
 36  
  * This software consists of voluntary contributions made by many 
 37  
  * individuals on behalf of the Jaxen Project and was originally 
 38  
  * created by bob mcwhirter <bob@werken.com> and 
 39  
  * James Strachan <jstrachan@apache.org>.  For more information on the 
 40  
  * Jaxen Project, please see <http://www.jaxen.org/>.
 41  
  *  
 42  
  */
 43  
 
 44  
 package org.jaxen.saxpath.base;
 45  
 
 46  
 /**
 47  
  * A utility class to handle well-formedness checks on names. 
 48  
  *
 49  
  * @author  Brett McLaughlin
 50  
  * @author  Elliotte Rusty Harold
 51  
  * @author  Jason Hunter
 52  
  * @author  Bradley S. Huffman
 53  
  */
 54  0
 final class Verifier {
 55  
 
 56  
     /**
 57  
      * This is a utility function for determining whether a specified 
 58  
      * character is a name character according to production 4 of the 
 59  
      * XML 1.0 specification.
 60  
      *
 61  
      * @param c <code>char</code> to check for XML name compliance.
 62  
      * @return <code>boolean</code> true if it's a name character, 
 63  
      *                                false otherwise
 64  
      */
 65  
      static boolean isXMLNCNameCharacter(char c) {
 66  
     
 67  104872
       return (isXMLLetter(c) || isXMLDigit(c) || c == '.' || c == '-' 
 68  
                              || c == '_' || isXMLCombiningChar(c) 
 69  
                              || isXMLExtender(c));
 70  
     }
 71  
 
 72  
     /**
 73  
      * This is a utility function for determining whether a specified 
 74  
      * character is a legal name start character according to production 5
 75  
      * of the XML 1.0 specification. This production does allow names
 76  
      * to begin with colons which the Namespaces in XML Recommendation
 77  
      * disallows. 
 78  
      *
 79  
      * @param c <code>char</code> to check for XML name start compliance
 80  
      * @return true if it's a name start character, false otherwise
 81  
      */
 82  
     static boolean isXMLNCNameStartCharacter(char c) {
 83  
     
 84  23362
       return (isXMLLetter(c) || c == '_');
 85  
     
 86  
     }
 87  
 
 88  
     /**
 89  
      * Determine whether a specified character
 90  
      * is a letter according to production 84 of the XML 1.0 specification.
 91  
      *
 92  
      * @param c <code>char</code> to check for XML name compliance
 93  
      * @return <code>String</code> true if it's a letter, false otherwise
 94  
      */
 95  
     static boolean isXMLLetter(char c) {
 96  
         // Note that order is very important here.  The search proceeds 
 97  
         // from lowest to highest values, so that no searching occurs 
 98  
         // above the character's value.  BTW, the first line is equivalent to:
 99  
         // if (c >= 0x0041 && c <= 0x005A) return true;
 100  
 
 101  128234
         if (c < 0x0041) return false;  if (c <= 0x005a) return true;
 102  110492
         if (c < 0x0061) return false;  if (c <= 0x007A) return true;
 103  7952
         if (c < 0x00C0) return false;  if (c <= 0x00D6) return true;
 104  7946
         if (c < 0x00D8) return false;  if (c <= 0x00F6) return true;
 105  7946
         if (c < 0x00F8) return false;  if (c <= 0x00FF) return true;
 106  7946
         if (c < 0x0100) return false;  if (c <= 0x0131) return true;
 107  7946
         if (c < 0x0134) return false;  if (c <= 0x013E) return true;
 108  7946
         if (c < 0x0141) return false;  if (c <= 0x0148) return true;
 109  7946
         if (c < 0x014A) return false;  if (c <= 0x017E) return true;
 110  7946
         if (c < 0x0180) return false;  if (c <= 0x01C3) return true;
 111  7946
         if (c < 0x01CD) return false;  if (c <= 0x01F0) return true;
 112  7946
         if (c < 0x01F4) return false;  if (c <= 0x01F5) return true;
 113  7946
         if (c < 0x01FA) return false;  if (c <= 0x0217) return true;
 114  7946
         if (c < 0x0250) return false;  if (c <= 0x02A8) return true;
 115  7946
         if (c < 0x02BB) return false;  if (c <= 0x02C1) return true;
 116  7946
         if (c == 0x0386) return true;
 117  7946
         if (c < 0x0388) return false;  if (c <= 0x038A) return true;
 118  7946
         if (c == 0x038C) return true;
 119  7946
         if (c < 0x038E) return false;  if (c <= 0x03A1) return true;
 120  7946
         if (c < 0x03A3) return false;  if (c <= 0x03CE) return true;
 121  7946
         if (c < 0x03D0) return false;  if (c <= 0x03D6) return true;
 122  7946
         if (c == 0x03DA) return true;
 123  7946
         if (c == 0x03DC) return true;
 124  7946
         if (c == 0x03DE) return true;
 125  7946
         if (c == 0x03E0) return true;
 126  7946
         if (c < 0x03E2) return false;  if (c <= 0x03F3) return true;
 127  7946
         if (c < 0x0401) return false;  if (c <= 0x040C) return true;
 128  7946
         if (c < 0x040E) return false;  if (c <= 0x044F) return true;
 129  7946
         if (c < 0x0451) return false;  if (c <= 0x045C) return true;
 130  7946
         if (c < 0x045E) return false;  if (c <= 0x0481) return true;
 131  7946
         if (c < 0x0490) return false;  if (c <= 0x04C4) return true;
 132  7946
         if (c < 0x04C7) return false;  if (c <= 0x04C8) return true;
 133  7946
         if (c < 0x04CB) return false;  if (c <= 0x04CC) return true;
 134  7946
         if (c < 0x04D0) return false;  if (c <= 0x04EB) return true;
 135  7946
         if (c < 0x04EE) return false;  if (c <= 0x04F5) return true;
 136  7946
         if (c < 0x04F8) return false;  if (c <= 0x04F9) return true;
 137  7946
         if (c < 0x0531) return false;  if (c <= 0x0556) return true;
 138  7946
         if (c == 0x0559) return true;
 139  7946
         if (c < 0x0561) return false;  if (c <= 0x0586) return true;
 140  7946
         if (c < 0x05D0) return false;  if (c <= 0x05EA) return true;
 141  7946
         if (c < 0x05F0) return false;  if (c <= 0x05F2) return true;
 142  7946
         if (c < 0x0621) return false;  if (c <= 0x063A) return true;
 143  7946
         if (c < 0x0641) return false;  if (c <= 0x064A) return true;
 144  7946
         if (c < 0x0671) return false;  if (c <= 0x06B7) return true;
 145  7946
         if (c < 0x06BA) return false;  if (c <= 0x06BE) return true;
 146  7946
         if (c < 0x06C0) return false;  if (c <= 0x06CE) return true;
 147  7946
         if (c < 0x06D0) return false;  if (c <= 0x06D3) return true;
 148  7946
         if (c == 0x06D5) return true;
 149  7946
         if (c < 0x06E5) return false;  if (c <= 0x06E6) return true;
 150  7946
         if (c < 0x0905) return false;  if (c <= 0x0939) return true;
 151  7946
         if (c == 0x093D) return true;
 152  7946
         if (c < 0x0958) return false;  if (c <= 0x0961) return true;
 153  7946
         if (c < 0x0985) return false;  if (c <= 0x098C) return true;
 154  7946
         if (c < 0x098F) return false;  if (c <= 0x0990) return true;
 155  7946
         if (c < 0x0993) return false;  if (c <= 0x09A8) return true;
 156  7946
         if (c < 0x09AA) return false;  if (c <= 0x09B0) return true;
 157  7946
         if (c == 0x09B2) return true;
 158  7946
         if (c < 0x09B6) return false;  if (c <= 0x09B9) return true;
 159  7946
         if (c < 0x09DC) return false;  if (c <= 0x09DD) return true;
 160  7946
         if (c < 0x09DF) return false;  if (c <= 0x09E1) return true;
 161  7946
         if (c < 0x09F0) return false;  if (c <= 0x09F1) return true;
 162  7946
         if (c < 0x0A05) return false;  if (c <= 0x0A0A) return true;
 163  7946
         if (c < 0x0A0F) return false;  if (c <= 0x0A10) return true;
 164  7946
         if (c < 0x0A13) return false;  if (c <= 0x0A28) return true;
 165  7946
         if (c < 0x0A2A) return false;  if (c <= 0x0A30) return true;
 166  7946
         if (c < 0x0A32) return false;  if (c <= 0x0A33) return true;
 167  7946
         if (c < 0x0A35) return false;  if (c <= 0x0A36) return true;
 168  7946
         if (c < 0x0A38) return false;  if (c <= 0x0A39) return true;
 169  7946
         if (c < 0x0A59) return false;  if (c <= 0x0A5C) return true;
 170  7946
         if (c == 0x0A5E) return true;
 171  7946
         if (c < 0x0A72) return false;  if (c <= 0x0A74) return true;
 172  7946
         if (c < 0x0A85) return false;  if (c <= 0x0A8B) return true;
 173  7946
         if (c == 0x0A8D) return true;
 174  7946
         if (c < 0x0A8F) return false;  if (c <= 0x0A91) return true;
 175  7946
         if (c < 0x0A93) return false;  if (c <= 0x0AA8) return true;
 176  7946
         if (c < 0x0AAA) return false;  if (c <= 0x0AB0) return true;
 177  7946
         if (c < 0x0AB2) return false;  if (c <= 0x0AB3) return true;
 178  7946
         if (c < 0x0AB5) return false;  if (c <= 0x0AB9) return true;
 179  7946
         if (c == 0x0ABD) return true;
 180  7946
         if (c == 0x0AE0) return true;
 181  7946
         if (c < 0x0B05) return false;  if (c <= 0x0B0C) return true;
 182  7946
         if (c < 0x0B0F) return false;  if (c <= 0x0B10) return true;
 183  7946
         if (c < 0x0B13) return false;  if (c <= 0x0B28) return true;
 184  7946
         if (c < 0x0B2A) return false;  if (c <= 0x0B30) return true;
 185  7946
         if (c < 0x0B32) return false;  if (c <= 0x0B33) return true;
 186  7946
         if (c < 0x0B36) return false;  if (c <= 0x0B39) return true;
 187  7946
         if (c == 0x0B3D) return true;
 188  7946
         if (c < 0x0B5C) return false;  if (c <= 0x0B5D) return true;
 189  7946
         if (c < 0x0B5F) return false;  if (c <= 0x0B61) return true;
 190  7946
         if (c < 0x0B85) return false;  if (c <= 0x0B8A) return true;
 191  7946
         if (c < 0x0B8E) return false;  if (c <= 0x0B90) return true;
 192  7946
         if (c < 0x0B92) return false;  if (c <= 0x0B95) return true;
 193  7946
         if (c < 0x0B99) return false;  if (c <= 0x0B9A) return true;
 194  7946
         if (c == 0x0B9C) return true;
 195  7946
         if (c < 0x0B9E) return false;  if (c <= 0x0B9F) return true;
 196  7946
         if (c < 0x0BA3) return false;  if (c <= 0x0BA4) return true;
 197  7946
         if (c < 0x0BA8) return false;  if (c <= 0x0BAA) return true;
 198  7946
         if (c < 0x0BAE) return false;  if (c <= 0x0BB5) return true;
 199  7946
         if (c < 0x0BB7) return false;  if (c <= 0x0BB9) return true;
 200  7946
         if (c < 0x0C05) return false;  if (c <= 0x0C0C) return true;
 201  7946
         if (c < 0x0C0E) return false;  if (c <= 0x0C10) return true;
 202  7946
         if (c < 0x0C12) return false;  if (c <= 0x0C28) return true;
 203  7946
         if (c < 0x0C2A) return false;  if (c <= 0x0C33) return true;
 204  7946
         if (c < 0x0C35) return false;  if (c <= 0x0C39) return true;
 205  7946
         if (c < 0x0C60) return false;  if (c <= 0x0C61) return true;
 206  7946
         if (c < 0x0C85) return false;  if (c <= 0x0C8C) return true;
 207  7946
         if (c < 0x0C8E) return false;  if (c <= 0x0C90) return true;
 208  7946
         if (c < 0x0C92) return false;  if (c <= 0x0CA8) return true;
 209  7946
         if (c < 0x0CAA) return false;  if (c <= 0x0CB3) return true;
 210  7946
         if (c < 0x0CB5) return false;  if (c <= 0x0CB9) return true;
 211  7946
         if (c == 0x0CDE) return true;
 212  7946
         if (c < 0x0CE0) return false;  if (c <= 0x0CE1) return true;
 213  7946
         if (c < 0x0D05) return false;  if (c <= 0x0D0C) return true;
 214  7946
         if (c < 0x0D0E) return false;  if (c <= 0x0D10) return true;
 215  7946
         if (c < 0x0D12) return false;  if (c <= 0x0D28) return true;
 216  7946
         if (c < 0x0D2A) return false;  if (c <= 0x0D39) return true;
 217  7946
         if (c < 0x0D60) return false;  if (c <= 0x0D61) return true;
 218  7946
         if (c < 0x0E01) return false;  if (c <= 0x0E2E) return true;
 219  7946
         if (c == 0x0E30) return true;
 220  7946
         if (c < 0x0E32) return false;  if (c <= 0x0E33) return true;
 221  7946
         if (c < 0x0E40) return false;  if (c <= 0x0E45) return true;
 222  7946
         if (c < 0x0E81) return false;  if (c <= 0x0E82) return true;
 223  7946
         if (c == 0x0E84) return true;
 224  7946
         if (c < 0x0E87) return false;  if (c <= 0x0E88) return true;
 225  7946
         if (c == 0x0E8A) return true;
 226  7946
         if (c == 0x0E8D) return true;
 227  7946
         if (c < 0x0E94) return false;  if (c <= 0x0E97) return true;
 228  7946
         if (c < 0x0E99) return false;  if (c <= 0x0E9F) return true;
 229  7946
         if (c < 0x0EA1) return false;  if (c <= 0x0EA3) return true;
 230  7946
         if (c == 0x0EA5) return true;
 231  7946
         if (c == 0x0EA7) return true;
 232  7946
         if (c < 0x0EAA) return false;  if (c <= 0x0EAB) return true;
 233  7946
         if (c < 0x0EAD) return false;  if (c <= 0x0EAE) return true;
 234  7946
         if (c == 0x0EB0) return true;
 235  7946
         if (c < 0x0EB2) return false;  if (c <= 0x0EB3) return true;
 236  7946
         if (c == 0x0EBD) return true;
 237  7946
         if (c < 0x0EC0) return false;  if (c <= 0x0EC4) return true;
 238  7946
         if (c < 0x0F40) return false;  if (c <= 0x0F47) return true;
 239  7946
         if (c < 0x0F49) return false;  if (c <= 0x0F69) return true;
 240  7946
         if (c < 0x10A0) return false;  if (c <= 0x10C5) return true;
 241  7946
         if (c < 0x10D0) return false;  if (c <= 0x10F6) return true;
 242  7946
         if (c == 0x1100) return true;
 243  7946
         if (c < 0x1102) return false;  if (c <= 0x1103) return true;
 244  7946
         if (c < 0x1105) return false;  if (c <= 0x1107) return true;
 245  7946
         if (c == 0x1109) return true;
 246  7946
         if (c < 0x110B) return false;  if (c <= 0x110C) return true;
 247  7946
         if (c < 0x110E) return false;  if (c <= 0x1112) return true;
 248  7946
         if (c == 0x113C) return true;
 249  7946
         if (c == 0x113E) return true;
 250  7946
         if (c == 0x1140) return true;
 251  7946
         if (c == 0x114C) return true;
 252  7946
         if (c == 0x114E) return true;
 253  7946
         if (c == 0x1150) return true;
 254  7946
         if (c < 0x1154) return false;  if (c <= 0x1155) return true;
 255  7946
         if (c == 0x1159) return true;
 256  7946
         if (c < 0x115F) return false;  if (c <= 0x1161) return true;
 257  7946
         if (c == 0x1163) return true;
 258  7946
         if (c == 0x1165) return true;
 259  7946
         if (c == 0x1167) return true;
 260  7946
         if (c == 0x1169) return true;
 261  7946
         if (c < 0x116D) return false;  if (c <= 0x116E) return true;
 262  7946
         if (c < 0x1172) return false;  if (c <= 0x1173) return true;
 263  7946
         if (c == 0x1175) return true;
 264  7946
         if (c == 0x119E) return true;
 265  7946
         if (c == 0x11A8) return true;
 266  7946
         if (c == 0x11AB) return true;
 267  7946
         if (c < 0x11AE) return false;  if (c <= 0x11AF) return true;
 268  7946
         if (c < 0x11B7) return false;  if (c <= 0x11B8) return true;
 269  7946
         if (c == 0x11BA) return true;
 270  7946
         if (c < 0x11BC) return false;  if (c <= 0x11C2) return true;
 271  7946
         if (c == 0x11EB) return true;
 272  7946
         if (c == 0x11F0) return true;
 273  7946
         if (c == 0x11F9) return true;
 274  7946
         if (c < 0x1E00) return false;  if (c <= 0x1E9B) return true;
 275  7946
         if (c < 0x1EA0) return false;  if (c <= 0x1EF9) return true;
 276  7946
         if (c < 0x1F00) return false;  if (c <= 0x1F15) return true;
 277  7946
         if (c < 0x1F18) return false;  if (c <= 0x1F1D) return true;
 278  7946
         if (c < 0x1F20) return false;  if (c <= 0x1F45) return true;
 279  7946
         if (c < 0x1F48) return false;  if (c <= 0x1F4D) return true;
 280  7946
         if (c < 0x1F50) return false;  if (c <= 0x1F57) return true;
 281  7946
         if (c == 0x1F59) return true;
 282  7946
         if (c == 0x1F5B) return true;
 283  7946
         if (c == 0x1F5D) return true;
 284  7946
         if (c < 0x1F5F) return false;  if (c <= 0x1F7D) return true;
 285  7946
         if (c < 0x1F80) return false;  if (c <= 0x1FB4) return true;
 286  7946
         if (c < 0x1FB6) return false;  if (c <= 0x1FBC) return true;
 287  7946
         if (c == 0x1FBE) return true;
 288  7946
         if (c < 0x1FC2) return false;  if (c <= 0x1FC4) return true;
 289  7946
         if (c < 0x1FC6) return false;  if (c <= 0x1FCC) return true;
 290  7946
         if (c < 0x1FD0) return false;  if (c <= 0x1FD3) return true;
 291  7946
         if (c < 0x1FD6) return false;  if (c <= 0x1FDB) return true;
 292  7946
         if (c < 0x1FE0) return false;  if (c <= 0x1FEC) return true;
 293  7946
         if (c < 0x1FF2) return false;  if (c <= 0x1FF4) return true;
 294  7946
         if (c < 0x1FF6) return false;  if (c <= 0x1FFC) return true;
 295  7946
         if (c == 0x2126) return true;
 296  7946
         if (c < 0x212A) return false;  if (c <= 0x212B) return true;
 297  7946
         if (c == 0x212E) return true;
 298  7946
         if (c < 0x2180) return false;  if (c <= 0x2182) return true;
 299  7946
         if (c == 0x3007) return true;                          
 300  7946
         if (c < 0x3021) return false;  if (c <= 0x3029) return true;
 301  7946
         if (c < 0x3041) return false;  if (c <= 0x3094) return true;
 302  7946
         if (c < 0x30A1) return false;  if (c <= 0x30FA) return true;
 303  7946
         if (c < 0x3105) return false;  if (c <= 0x312C) return true;
 304  7946
         if (c < 0x4E00) return false;  if (c <= 0x9FA5) return true;
 305  7946
         if (c < 0xAC00) return false;  if (c <= 0xD7A3) return true;
 306  
       
 307  7946
         return false;
 308  
         
 309  
     }
 310  
 
 311  
     /**
 312  
      * Determine whether a specified character
 313  
      * is a combining character according to production 87
 314  
      * of the XML 1.0 specification.
 315  
      *
 316  
      * @param c <code>char</code> to check
 317  
      * @return <code>boolean</code> true if it's a combining character,
 318  
      *         false otherwise
 319  
      */
 320  
     static boolean isXMLCombiningChar(char c) {
 321  
         // CombiningChar
 322  13508
         if (c < 0x0300) return false;  if (c <= 0x0345) return true;
 323  0
         if (c < 0x0360) return false;  if (c <= 0x0361) return true;
 324  0
         if (c < 0x0483) return false;  if (c <= 0x0486) return true;
 325  0
         if (c < 0x0591) return false;  if (c <= 0x05A1) return true;
 326  
                                        
 327  0
         if (c < 0x05A3) return false;  if (c <= 0x05B9) return true;
 328  0
         if (c < 0x05BB) return false;  if (c <= 0x05BD) return true;
 329  0
         if (c == 0x05BF) return true;
 330  0
         if (c < 0x05C1) return false;  if (c <= 0x05C2) return true;
 331  
                                        
 332  0
         if (c == 0x05C4) return true;
 333  0
         if (c < 0x064B) return false;  if (c <= 0x0652) return true;
 334  0
         if (c == 0x0670) return true;
 335  0
         if (c < 0x06D6) return false;  if (c <= 0x06DC) return true;
 336  
                                        
 337  0
         if (c < 0x06DD) return false;  if (c <= 0x06DF) return true;
 338  0
         if (c < 0x06E0) return false;  if (c <= 0x06E4) return true;
 339  0
         if (c < 0x06E7) return false;  if (c <= 0x06E8) return true;
 340  
                                        
 341  0
         if (c < 0x06EA) return false;  if (c <= 0x06ED) return true;
 342  0
         if (c < 0x0901) return false;  if (c <= 0x0903) return true;
 343  0
         if (c == 0x093C) return true;
 344  0
         if (c < 0x093E) return false;  if (c <= 0x094C) return true;
 345  
                                        
 346  0
         if (c == 0x094D) return true;
 347  0
         if (c < 0x0951) return false;  if (c <= 0x0954) return true;
 348  0
         if (c < 0x0962) return false;  if (c <= 0x0963) return true;
 349  0
         if (c < 0x0981) return false;  if (c <= 0x0983) return true;
 350  
                                        
 351  0
         if (c == 0x09BC) return true;
 352  0
         if (c == 0x09BE) return true;
 353  0
         if (c == 0x09BF) return true;
 354  0
         if (c < 0x09C0) return false;  if (c <= 0x09C4) return true;
 355  0
         if (c < 0x09C7) return false;  if (c <= 0x09C8) return true;
 356  
                                        
 357  0
         if (c < 0x09CB) return false;  if (c <= 0x09CD) return true;
 358  0
         if (c == 0x09D7) return true;
 359  0
         if (c < 0x09E2) return false;  if (c <= 0x09E3) return true;
 360  0
         if (c == 0x0A02) return true;
 361  0
         if (c == 0x0A3C) return true;
 362  
                                        
 363  0
         if (c == 0x0A3E) return true;
 364  0
         if (c == 0x0A3F) return true;
 365  0
         if (c < 0x0A40) return false;  if (c <= 0x0A42) return true;
 366  0
         if (c < 0x0A47) return false;  if (c <= 0x0A48) return true;
 367  
                                        
 368  0
         if (c < 0x0A4B) return false;  if (c <= 0x0A4D) return true;
 369  0
         if (c < 0x0A70) return false;  if (c <= 0x0A71) return true;
 370  0
         if (c < 0x0A81) return false;  if (c <= 0x0A83) return true;
 371  0
         if (c == 0x0ABC) return true;
 372  
                                        
 373  0
         if (c < 0x0ABE) return false;  if (c <= 0x0AC5) return true;
 374  0
         if (c < 0x0AC7) return false;  if (c <= 0x0AC9) return true;
 375  0
         if (c < 0x0ACB) return false;  if (c <= 0x0ACD) return true;
 376  
                                        
 377  0
         if (c < 0x0B01) return false;  if (c <= 0x0B03) return true;
 378  0
         if (c == 0x0B3C) return true;
 379  0
         if (c < 0x0B3E) return false;  if (c <= 0x0B43) return true;
 380  0
         if (c < 0x0B47) return false;  if (c <= 0x0B48) return true;
 381  
                                        
 382  0
         if (c < 0x0B4B) return false;  if (c <= 0x0B4D) return true;
 383  0
         if (c < 0x0B56) return false;  if (c <= 0x0B57) return true;
 384  0
         if (c < 0x0B82) return false;  if (c <= 0x0B83) return true;
 385  
                                        
 386  0
         if (c < 0x0BBE) return false;  if (c <= 0x0BC2) return true;
 387  0
         if (c < 0x0BC6) return false;  if (c <= 0x0BC8) return true;
 388  0
         if (c < 0x0BCA) return false;  if (c <= 0x0BCD) return true;
 389  0
         if (c == 0x0BD7) return true;
 390  
                                        
 391  0
         if (c < 0x0C01) return false;  if (c <= 0x0C03) return true;
 392  0
         if (c < 0x0C3E) return false;  if (c <= 0x0C44) return true;
 393  0
         if (c < 0x0C46) return false;  if (c <= 0x0C48) return true;
 394  
                                        
 395  0
         if (c < 0x0C4A) return false;  if (c <= 0x0C4D) return true;
 396  0
         if (c < 0x0C55) return false;  if (c <= 0x0C56) return true;
 397  0
         if (c < 0x0C82) return false;  if (c <= 0x0C83) return true;
 398  
                                        
 399  0
         if (c < 0x0CBE) return false;  if (c <= 0x0CC4) return true;
 400  0
         if (c < 0x0CC6) return false;  if (c <= 0x0CC8) return true;
 401  0
         if (c < 0x0CCA) return false;  if (c <= 0x0CCD) return true;
 402  
                                        
 403  0
         if (c < 0x0CD5) return false;  if (c <= 0x0CD6) return true;
 404  0
         if (c < 0x0D02) return false;  if (c <= 0x0D03) return true;
 405  0
         if (c < 0x0D3E) return false;  if (c <= 0x0D43) return true;
 406  
                                        
 407  0
         if (c < 0x0D46) return false;  if (c <= 0x0D48) return true;
 408  0
         if (c < 0x0D4A) return false;  if (c <= 0x0D4D) return true;
 409  0
         if (c == 0x0D57) return true;
 410  0
         if (c == 0x0E31) return true;
 411  
                                        
 412  0
         if (c < 0x0E34) return false;  if (c <= 0x0E3A) return true;
 413  0
         if (c < 0x0E47) return false;  if (c <= 0x0E4E) return true;
 414  0
         if (c == 0x0EB1) return true;
 415  0
         if (c < 0x0EB4) return false;  if (c <= 0x0EB9) return true;
 416  
                                        
 417  0
         if (c < 0x0EBB) return false;  if (c <= 0x0EBC) return true;
 418  0
         if (c < 0x0EC8) return false;  if (c <= 0x0ECD) return true;
 419  0
         if (c < 0x0F18) return false;  if (c <= 0x0F19) return true;
 420  0
         if (c == 0x0F35) return true;
 421  
                                        
 422  0
         if (c == 0x0F37) return true;
 423  0
         if (c == 0x0F39) return true;
 424  0
         if (c == 0x0F3E) return true;
 425  0
         if (c == 0x0F3F) return true;
 426  0
         if (c < 0x0F71) return false;  if (c <= 0x0F84) return true;
 427  
                                        
 428  0
         if (c < 0x0F86) return false;  if (c <= 0x0F8B) return true;
 429  0
         if (c < 0x0F90) return false;  if (c <= 0x0F95) return true;
 430  0
         if (c == 0x0F97) return true;
 431  0
         if (c < 0x0F99) return false;  if (c <= 0x0FAD) return true;
 432  
                                        
 433  0
         if (c < 0x0FB1) return false;  if (c <= 0x0FB7) return true;
 434  0
         if (c == 0x0FB9) return true;
 435  0
         if (c < 0x20D0) return false;  if (c <= 0x20DC) return true;
 436  0
         if (c == 0x20E1) return true;
 437  
                                        
 438  0
         if (c < 0x302A) return false;  if (c <= 0x302F) return true;
 439  0
         if (c == 0x3099) return true;
 440  0
         if (c == 0x309A) return true; 
 441  
         
 442  0
         return false;
 443  
         
 444  
     }
 445  
     
 446  
     /**
 447  
      * Determine whether a specified 
 448  
      * character is an extender according to production 88 of the XML 1.0
 449  
      * specification.
 450  
      *
 451  
      * @param c <code>char</code> to check
 452  
      * @return true if it's an extender, false otherwise
 453  
      */
 454  
     static boolean isXMLExtender(char c) {
 455  
 
 456  13508
         if (c < 0x00B6) return false;  // quick short circuit
 457  
 
 458  
         // Extenders                               
 459  0
         if (c == 0x00B7) return true;
 460  0
         if (c == 0x02D0) return true;
 461  0
         if (c == 0x02D1) return true;
 462  0
         if (c == 0x0387) return true;
 463  0
         if (c == 0x0640) return true;
 464  0
         if (c == 0x0E46) return true;
 465  0
         if (c == 0x0EC6) return true;
 466  0
         if (c == 0x3005) return true;
 467  
                                        
 468  0
         if (c < 0x3031) return false;  if (c <= 0x3035) return true;
 469  0
         if (c < 0x309D) return false;  if (c <= 0x309E) return true;
 470  0
         if (c < 0x30FC) return false;  if (c <= 0x30FE) return true;
 471  
         
 472  0
         return false;
 473  
         
 474  
     }
 475  
       
 476  
     /**
 477  
      * Determine whether a specified Unicode character
 478  
      * is a digit according to production 88 of the XML 1.0 specification.
 479  
      *
 480  
      * @param c <code>char</code> to check for XML digit compliance
 481  
      * @return <code>boolean</code> true if it's a digit, false otherwise
 482  
      */
 483  
     static boolean isXMLDigit(char c) {
 484  
       
 485  16446
         if (c < 0x0030) return false;  if (c <= 0x0039) return true;
 486  6182
         if (c < 0x0660) return false;  if (c <= 0x0669) return true;
 487  0
         if (c < 0x06F0) return false;  if (c <= 0x06F9) return true;
 488  0
         if (c < 0x0966) return false;  if (c <= 0x096F) return true;
 489  
                                        
 490  0
         if (c < 0x09E6) return false;  if (c <= 0x09EF) return true;
 491  0
         if (c < 0x0A66) return false;  if (c <= 0x0A6F) return true;
 492  0
         if (c < 0x0AE6) return false;  if (c <= 0x0AEF) return true;
 493  
                                        
 494  0
         if (c < 0x0B66) return false;  if (c <= 0x0B6F) return true;
 495  0
         if (c < 0x0BE7) return false;  if (c <= 0x0BEF) return true;
 496  0
         if (c < 0x0C66) return false;  if (c <= 0x0C6F) return true;
 497  
                                        
 498  0
         if (c < 0x0CE6) return false;  if (c <= 0x0CEF) return true;
 499  0
         if (c < 0x0D66) return false;  if (c <= 0x0D6F) return true;
 500  0
         if (c < 0x0E50) return false;  if (c <= 0x0E59) return true;
 501  
                                        
 502  0
         if (c < 0x0ED0) return false;  if (c <= 0x0ED9) return true;
 503  0
         if (c < 0x0F20) return false;  if (c <= 0x0F29) return true; 
 504  
       
 505  0
         return false;
 506  
     }  
 507  
     
 508  
 }