1 19 20 package org.netbeans.lib.xml.lexer; 21 22 30 public class UnicodeClasses { 31 32 33 UnicodeClasses () { 34 } 35 36 40 43 public static boolean isXMLChar (int c) { 44 if ( c == 0x0009 ) return true; 46 47 if ( c == 0x000a ) return true; 49 50 if ( c == 0x000d ) return true; 52 53 if ( c < 0x0020 ) return false; 55 if ( c <= 0xd7ff ) return true; 56 57 if ( c < 0xe000 ) return false; 59 if ( c <= 0xfffd ) return true; 60 61 if ( c < 0x10000 ) return false; 63 if ( c <= 0x10ffff ) return true; 64 65 return false; 66 } 67 68 71 public static boolean isXMLNameChar (int c) { 72 return ( ( isXMLLetter (c) ) 73 || ( isXMLDigit (c) ) 74 || ( c == '.' ) 75 || ( c == '-' ) 76 || ( c == '_' ) 77 || ( c == ':' ) 78 || ( isXMLCombiningChar (c) ) 79 || ( isXMLExtender (c) ) ); 80 } 81 82 85 public static boolean isXMLNameStartChar (int c) { 86 return ( ( isXMLLetter (c) ) 87 || ( c == '_' ) 88 || ( c ==':' ) ); 89 } 90 91 94 public static boolean isXMLLetter (int c) { 95 return ( isXMLBaseChar (c) || isXMLIdeographic (c) ); 96 } 97 98 101 public static boolean isXMLBaseChar (int c) { 102 if ( c < 0x0041 ) return false; 104 if ( c <= 0x005a ) return true; 105 106 if ( c < 0x0061 ) return false; 108 if ( c <= 0x007a ) return true; 109 110 if ( c < 0x00c0 ) return false; 112 if ( c <= 0x00d6 ) return true; 113 114 if ( c < 0x00d8 ) return false; 116 if ( c <= 0x00f6 ) return true; 117 118 if ( c < 0x00f8 ) return false; 120 if ( c <= 0x00ff ) return true; 121 122 if ( c < 0x0100 ) return false; 124 if ( c <= 0x0131 ) return true; 125 126 if ( c < 0x0134 ) return false; 128 if ( c <= 0x013e ) return true; 129 130 if ( c < 0x0141 ) return false; 132 if ( c <= 0x0148 ) return true; 133 134 if ( c < 0x014a ) return false; 136 if ( c <= 0x017e ) return true; 137 138 if ( c < 0x0180 ) return false; 140 if ( c <= 0x01c3 ) return true; 141 142 if ( c < 0x01cd ) return false; 144 if ( c <= 0x01f0 ) return true; 145 146 if ( c < 0x01f4 ) return false; 148 if ( c <= 0x01f5 ) return true; 149 150 if ( c < 0x01fa ) return false; 152 if ( c <= 0x0217 ) return true; 153 154 if ( c < 0x0250 ) return false; 156 if ( c <= 0x02a8 ) return true; 157 158 if ( c < 0x02bb ) return false; 160 if ( c <= 0x02c1 ) return true; 161 162 if ( c == 0x0386 ) return true; 164 165 if ( c < 0x0388 ) return false; 167 if ( c <= 0x038a ) return true; 168 169 if ( c == 0x038c ) return true; 171 172 if ( c < 0x038e ) return false; 174 if ( c <= 0x03a1 ) return true; 175 176 if ( c < 0x03a3 ) return false; 178 if ( c <= 0x03ce ) return true; 179 180 if ( c < 0x03d0 ) return false; 182 if ( c <= 0x03d6 ) return true; 183 184 if ( c == 0x03da ) return true; 186 187 if ( c == 0x03dc ) return true; 189 190 if ( c == 0x03de ) return true; 192 193 if ( c == 0x03e0 ) return true; 195 196 if ( c < 0x03e2 ) return false; 198 if ( c <= 0x03f3 ) return true; 199 200 if ( c < 0x0401 ) return false; 202 if ( c <= 0x040c ) return true; 203 204 if ( c < 0x040e ) return false; 206 if ( c <= 0x044f ) return true; 207 208 if ( c < 0x0451 ) return false; 210 if ( c <= 0x045c ) return true; 211 212 if ( c < 0x045e ) return false; 214 if ( c <= 0x0481 ) return true; 215 216 if ( c < 0x0490 ) return false; 218 if ( c <= 0x04c4 ) return true; 219 220 if ( c < 0x04c7 ) return false; 222 if ( c <= 0x04c8 ) return true; 223 224 if ( c < 0x04cb ) return false; 226 if ( c <= 0x04cc ) return true; 227 228 if ( c < 0x04d0 ) return false; 230 if ( c <= 0x04eb ) return true; 231 232 if ( c < 0x04ee ) return false; 234 if ( c <= 0x04f5 ) return true; 235 236 if ( c < 0x04f8 ) return false; 238 if ( c <= 0x04f9 ) return true; 239 240 if ( c < 0x0531 ) return false; 242 if ( c <= 0x0556 ) return true; 243 244 if ( c == 0x0559 ) return true; 246 247 if ( c < 0x0561 ) return false; 249 if ( c <= 0x0586 ) return true; 250 251 if ( c < 0x05d0 ) return false; 253 if ( c <= 0x05ea ) return true; 254 255 if ( c < 0x05f0 ) return false; 257 if ( c <= 0x05f2 ) return true; 258 259 if ( c < 0x0621 ) return false; 261 if ( c <= 0x063a ) return true; 262 263 if ( c < 0x0641 ) return false; 265 if ( c <= 0x064a ) return true; 266 267 if ( c < 0x0671 ) return false; 269 if ( c <= 0x06b7 ) return true; 270 271 if ( c < 0x06ba ) return false; 273 if ( c <= 0x06be ) return true; 274 275 if ( c < 0x06c0 ) return false; 277 if ( c <= 0x06ce ) return true; 278 279 if ( c < 0x06d0 ) return false; 281 if ( c <= 0x06d3 ) return true; 282 283 if ( c == 0x06d5 ) return true; 285 286 if ( c < 0x06e5 ) return false; 288 if ( c <= 0x06e6 ) return true; 289 290 if ( c < 0x0905 ) return false; 292 if ( c <= 0x0939 ) return true; 293 294 if ( c == 0x093d ) return true; 296 297 if ( c < 0x0958 ) return false; 299 if ( c <= 0x0961 ) return true; 300 301 if ( c < 0x0985 ) return false; 303 if ( c <= 0x098c ) return true; 304 305 if ( c < 0x098f ) return false; 307 if ( c <= 0x0990 ) return true; 308 309 if ( c < 0x0993 ) return false; 311 if ( c <= 0x09a8 ) return true; 312 313 if ( c < 0x09aa ) return false; 315 if ( c <= 0x09b0 ) return true; 316 317 if ( c == 0x09b2 ) return true; 319 320 if ( c < 0x09b6 ) return false; 322 if ( c <= 0x09b9 ) return true; 323 324 if ( c < 0x09dc ) return false; 326 if ( c <= 0x09dd ) return true; 327 328 if ( c < 0x09df ) return false; 330 if ( c <= 0x09e1 ) return true; 331 332 if ( c < 0x09f0 ) return false; 334 if ( c <= 0x09f1 ) return true; 335 336 if ( c < 0x0a05 ) return false; 338 if ( c <= 0x0a0a ) return true; 339 340 if ( c < 0x0a0f ) return false; 342 if ( c <= 0x0a10 ) return true; 343 344 if ( c < 0x0a13 ) return false; 346 if ( c <= 0x0a28 ) return true; 347 348 if ( c < 0x0a2a ) return false; 350 if ( c <= 0x0a30 ) return true; 351 352 if ( c < 0x0a32 ) return false; 354 if ( c <= 0x0a33 ) return true; 355 356 if ( c < 0x0a35 ) return false; 358 if ( c <= 0x0a36 ) return true; 359 360 if ( c < 0x0a38 ) return false; 362 if ( c <= 0x0a39 ) return true; 363 364 if ( c < 0x0a59 ) return false; 366 if ( c <= 0x0a5c ) return true; 367 368 if ( c == 0x0a5e ) return true; 370 371 if ( c < 0x0a72 ) return false; 373 if ( c <= 0x0a74 ) return true; 374 375 if ( c < 0x0a85 ) return false; 377 if ( c <= 0x0a8b ) return true; 378 379 if ( c == 0x0a8d ) return true; 381 382 if ( c < 0x0a8f ) return false; 384 if ( c <= 0x0a91 ) return true; 385 386 if ( c < 0x0a93 ) return false; 388 if ( c <= 0x0aa8 ) return true; 389 390 if ( c < 0x0aaa ) return false; 392 if ( c <= 0x0ab0 ) return true; 393 394 if ( c < 0x0ab2 ) return false; 396 if ( c <= 0x0ab3 ) return true; 397 398 if ( c < 0x0ab5 ) return false; 400 if ( c <= 0x0ab9 ) return true; 401 402 if ( c == 0x0abd ) return true; 404 405 if ( c == 0x0ae0 ) return true; 407 408 if ( c < 0x0b05 ) return false; 410 if ( c <= 0x0b0c ) return true; 411 412 if ( c < 0x0b0f ) return false; 414 if ( c <= 0x0b10 ) return true; 415 416 if ( c < 0x0b13 ) return false; 418 if ( c <= 0x0b28 ) return true; 419 420 if ( c < 0x0b2a ) return false; 422 if ( c <= 0x0b30 ) return true; 423 424 if ( c < 0x0b32 ) return false; 426 if ( c <= 0x0b33 ) return true; 427 428 if ( c < 0x0b36 ) return false; 430 if ( c <= 0x0b39 ) return true; 431 432 if ( c == 0x0b3d ) return true; 434 435 if ( c < 0x0b5c ) return false; 437 if ( c <= 0x0b5d ) return true; 438 439 if ( c < 0x0b5f ) return false; 441 if ( c <= 0x0b61 ) return true; 442 443 if ( c < 0x0b85 ) return false; 445 if ( c <= 0x0b8a ) return true; 446 447 if ( c < 0x0b8e ) return false; 449 if ( c <= 0x0b90 ) return true; 450 451 if ( c < 0x0b92 ) return false; 453 if ( c <= 0x0b95 ) return true; 454 455 if ( c < 0x0b99 ) return false; 457 if ( c <= 0x0b9a ) return true; 458 459 if ( c == 0x0b9c ) return true; 461 462 if ( c < 0x0b9e ) return false; 464 if ( c <= 0x0b9f ) return true; 465 466 if ( c < 0x0ba3 ) return false; 468 if ( c <= 0x0ba4 ) return true; 469 470 if ( c < 0x0ba8 ) return false; 472 if ( c <= 0x0baa ) return true; 473 474 if ( c < 0x0bae ) return false; 476 if ( c <= 0x0bb5 ) return true; 477 478 if ( c < 0x0bb7 ) return false; 480 if ( c <= 0x0bb9 ) return true; 481 482 if ( c < 0x0c05 ) return false; 484 if ( c <= 0x0c0c ) return true; 485 486 if ( c < 0x0c0e ) return false; 488 if ( c <= 0x0c10 ) return true; 489 490 if ( c < 0x0c12 ) return false; 492 if ( c <= 0x0c28 ) return true; 493 494 if ( c < 0x0c2a ) return false; 496 if ( c <= 0x0c33 ) return true; 497 498 if ( c < 0x0c35 ) return false; 500 if ( c <= 0x0c39 ) return true; 501 502 if ( c < 0x0c60 ) return false; 504 if ( c <= 0x0c61 ) return true; 505 506 if ( c < 0x0c85 ) return false; 508 if ( c <= 0x0c8c ) return true; 509 510 if ( c < 0x0c8e ) return false; 512 if ( c <= 0x0c90 ) return true; 513 514 if ( c < 0x0c92 ) return false; 516 if ( c <= 0x0ca8 ) return true; 517 518 if ( c < 0x0caa ) return false; 520 if ( c <= 0x0cb3 ) return true; 521 522 if ( c < 0x0cb5 ) return false; 524 if ( c <= 0x0cb9 ) return true; 525 526 if ( c == 0x0cde ) return true; 528 529 if ( c < 0x0ce0 ) return false; 531 if ( c <= 0x0ce1 ) return true; 532 533 if ( c < 0x0d05 ) return false; 535 if ( c <= 0x0d0c ) return true; 536 537 if ( c < 0x0d0e ) return false; 539 if ( c <= 0x0d10 ) return true; 540 541 if ( c < 0x0d12 ) return false; 543 if ( c <= 0x0d28 ) return true; 544 545 if ( c < 0x0d2a ) return false; 547 if ( c <= 0x0d39 ) return true; 548 549 if ( c < 0x0d60 ) return false; 551 if ( c <= 0x0d61 ) return true; 552 553 if ( c < 0x0e01 ) return false; 555 if ( c <= 0x0e2e ) return true; 556 557 if ( c == 0x0e30 ) return true; 559 560 if ( c < 0x0e32 ) return false; 562 if ( c <= 0x0e33 ) return true; 563 564 if ( c < 0x0e40 ) return false; 566 if ( c <= 0x0e45 ) return true; 567 568 if ( c < 0x0e81 ) return false; 570 if ( c <= 0x0e82 ) return true; 571 572 if ( c == 0x0e84 ) return true; 574 575 if ( c < 0x0e87 ) return false; 577 if ( c <= 0x0e88 ) return true; 578 579 if ( c == 0x0e8a ) return true; 581 582 if ( c == 0x0e8d ) return true; 584 585 if ( c < 0x0e94 ) return false; 587 if ( c <= 0x0e97 ) return true; 588 589 if ( c < 0x0e99 ) return false; 591 if ( c <= 0x0e9f ) return true; 592 593 if ( c < 0x0ea1 ) return false; 595 if ( c <= 0x0ea3 ) return true; 596 597 if ( c == 0x0ea5 ) return true; 599 600 if ( c == 0x0ea7 ) return true; 602 603 if ( c < 0x0eaa ) return false; 605 if ( c <= 0x0eab ) return true; 606 607 if ( c < 0x0ead ) return false; 609 if ( c <= 0x0eae ) return true; 610 611 if ( c == 0x0eb0 ) return true; 613 614 if ( c < 0x0eb2 ) return false; 616 if ( c <= 0x0eb3 ) return true; 617 618 if ( c == 0x0ebd ) return true; 620 621 if ( c < 0x0ec0 ) return false; 623 if ( c <= 0x0ec4 ) return true; 624 625 if ( c < 0x0f40 ) return false; 627 if ( c <= 0x0f47 ) return true; 628 629 if ( c < 0x0f49 ) return false; 631 if ( c <= 0x0f69 ) return true; 632 633 if ( c < 0x10a0 ) return false; 635 if ( c <= 0x10c5 ) return true; 636 637 if ( c < 0x10d0 ) return false; 639 if ( c <= 0x10f6 ) return true; 640 641 if ( c == 0x1100 ) return true; 643 644 if ( c < 0x1102 ) return false; 646 if ( c <= 0x1103 ) return true; 647 648 if ( c < 0x1105 ) return false; 650 if ( c <= 0x1107 ) return true; 651 652 if ( c == 0x1109 ) return true; 654 655 if ( c < 0x110b ) return false; 657 if ( c <= 0x110c ) return true; 658 659 if ( c < 0x110e ) return false; 661 if ( c <= 0x1112 ) return true; 662 663 if ( c == 0x113c ) return true; 665 666 if ( c == 0x113e ) return true; 668 669 if ( c == 0x1140 ) return true; 671 672 if ( c == 0x114c ) return true; 674 675 if ( c == 0x114e ) return true; 677 678 if ( c == 0x1150 ) return true; 680 681 if ( c < 0x1154 ) return false; 683 if ( c <= 0x1155 ) return true; 684 685 if ( c == 0x1159 ) return true; 687 688 if ( c < 0x115f ) return false; 690 if ( c <= 0x1161 ) return true; 691 692 if ( c == 0x1163 ) return true; 694 695 if ( c == 0x1165 ) return true; 697 698 if ( c == 0x1167 ) return true; 700 701 if ( c == 0x1169 ) return true; 703 704 if ( c < 0x116d ) return false; 706 if ( c <= 0x116e ) return true; 707 708 if ( c < 0x1172 ) return false; 710 if ( c <= 0x1173 ) return true; 711 712 if ( c == 0x1175 ) return true; 714 715 if ( c == 0x119e ) return true; 717 718 if ( c == 0x11a8 ) return true; 720 721 if ( c == 0x11ab ) return true; 723 724 if ( c < 0x11ae ) return false; 726 if ( c <= 0x11af ) return true; 727 728 if ( c < 0x11b7 ) return false; 730 if ( c <= 0x11b8 ) return true; 731 732 if ( c == 0x11ba ) return true; 734 735 if ( c < 0x11bc ) return false; 737 if ( c <= 0x11c2 ) return true; 738 739 if ( c == 0x11eb ) return true; 741 742 if ( c == 0x11f0 ) return true; 744 745 if ( c == 0x11f9 ) return true; 747 748 if ( c < 0x1e00 ) return false; 750 if ( c <= 0x1e9b ) return true; 751 752 if ( c < 0x1ea0 ) return false; 754 if ( c <= 0x1ef9 ) return true; 755 756 if ( c < 0x1f00 ) return false; 758 if ( c <= 0x1f15 ) return true; 759 760 if ( c < 0x1f18 ) return false; 762 if ( c <= 0x1f1d ) return true; 763 764 if ( c < 0x1f20 ) return false; 766 if ( c <= 0x1f45 ) return true; 767 768 if ( c < 0x1f48 ) return false; 770 if ( c <= 0x1f4d ) return true; 771 772 if ( c < 0x1f50 ) return false; 774 if ( c <= 0x1f57 ) return true; 775 776 if ( c == 0x1f59 ) return true; 778 779 if ( c == 0x1f5b ) return true; 781 782 if ( c == 0x1f5d ) return true; 784 785 if ( c < 0x1f5f ) return false; 787 if ( c <= 0x1f7d ) return true; 788 789 if ( c < 0x1f80 ) return false; 791 if ( c <= 0x1fb4 ) return true; 792 793 if ( c < 0x1fb6 ) return false; 795 if ( c <= 0x1fbc ) return true; 796 797 if ( c == 0x1fbe ) return true; 799 800 if ( c < 0x1fc2 ) return false; 802 if ( c <= 0x1fc4 ) return true; 803 804 if ( c < 0x1fc6 ) return false; 806 if ( c <= 0x1fcc ) return true; 807 808 if ( c < 0x1fd0 ) return false; 810 if ( c <= 0x1fd3 ) return true; 811 812 if ( c < 0x1fd6 ) return false; 814 if ( c <= 0x1fdb ) return true; 815 816 if ( c < 0x1fe0 ) return false; 818 if ( c <= 0x1fec ) return true; 819 820 if ( c < 0x1ff2 ) return false; 822 if ( c <= 0x1ff4 ) return true; 823 824 if ( c < 0x1ff6 ) return false; 826 if ( c <= 0x1ffc ) return true; 827 828 if ( c == 0x2126 ) return true; 830 831 if ( c < 0x212a ) return false; 833 if ( c <= 0x212b ) return true; 834 835 if ( c == 0x212e ) return true; 837 838 if ( c < 0x2180 ) return false; 840 if ( c <= 0x2182 ) return true; 841 842 if ( c < 0x3041 ) return false; 844 if ( c <= 0x3094 ) return true; 845 846 if ( c < 0x30a1 ) return false; 848 if ( c <= 0x30fa ) return true; 849 850 if ( c < 0x3105 ) return false; 852 if ( c <= 0x312c ) return true; 853 854 if ( c < 0xac00 ) return false; 856 if ( c <= 0xd7a3 ) return true; 857 858 return false; 859 } 860 861 862 865 public static boolean isXMLIdeographic (int c) { 866 if ( c == 0x3007 ) return true; 868 869 if ( c < 0x3021 ) return false; 871 if ( c <= 0x3029 ) return true; 872 873 if ( c < 0x4e00 ) return false; 875 if ( c <= 0x9fa5 ) return true; 876 877 return false; 878 } 879 880 881 884 public static boolean isXMLCombiningChar (int c) { 885 if ( c < 0x0300 ) return false; 887 if ( c <= 0x0345 ) return true; 888 889 if ( c < 0x0360 ) return false; 891 if ( c <= 0x0361 ) return true; 892 893 if ( c < 0x0483 ) return false; 895 if ( c <= 0x0486 ) return true; 896 897 if ( c < 0x0591 ) return false; 899 if ( c <= 0x05a1 ) return true; 900 901 if ( c < 0x05a3 ) return false; 903 if ( c <= 0x05b9 ) return true; 904 905 if ( c < 0x05bb ) return false; 907 if ( c <= 0x05bd ) return true; 908 909 if ( c == 0x05bf ) return true; 911 912 if ( c < 0x05c1 ) return false; 914 if ( c <= 0x05c2 ) return true; 915 916 if ( c == 0x05c4 ) return true; 918 919 if ( c < 0x064b ) return false; 921 if ( c <= 0x0652 ) return true; 922 923 if ( c == 0x0670 ) return true; 925 926 if ( c < 0x06d6 ) return false; 928 if ( c <= 0x06dc ) return true; 929 930 if ( c < 0x06dd ) return false; 932 if ( c <= 0x06df ) return true; 933 934 if ( c < 0x06e0 ) return false; 936 if ( c <= 0x06e4 ) return true; 937 938 if ( c < 0x06e7 ) return false; 940 if ( c <= 0x06e8 ) return true; 941 942 if ( c < 0x06ea ) return false; 944 if ( c <= 0x06ed ) return true; 945 946 if ( c < 0x0901 ) return false; 948 if ( c <= 0x0903 ) return true; 949 950 if ( c == 0x093c ) return true; 952 953 if ( c < 0x093e ) return false; 955 if ( c <= 0x094c ) return true; 956 957 if ( c == 0x094d ) return true; 959 960 if ( c < 0x0951 ) return false; 962 if ( c <= 0x0954 ) return true; 963 964 if ( c < 0x0962 ) return false; 966 if ( c <= 0x0963 ) return true; 967 968 if ( c < 0x0981 ) return false; 970 if ( c <= 0x0983 ) return true; 971 972 if ( c == 0x09bc ) return true; 974 975 if ( c == 0x09be ) return true; 977 978 if ( c == 0x09bf ) return true; 980 981 if ( c < 0x09c0 ) return false; 983 if ( c <= 0x09c4 ) return true; 984 985 if ( c < 0x09c7 ) return false; 987 if ( c <= 0x09c8 ) return true; 988 989 if ( c < 0x09cb ) return false; 991 if ( c <= 0x09cd ) return true; 992 993 if ( c == 0x09d7 ) return true; 995 996 if ( c < 0x09e2 ) return false; 998 if ( c <= 0x09e3 ) return true; 999 1000 if ( c == 0x0a02 ) return true; 1002 1003 if ( c == 0x0a3c ) return true; 1005 1006 if ( c == 0x0a3e ) return true; 1008 1009 if ( c == 0x0a3f ) return true; 1011 1012 if ( c < 0x0a40 ) return false; 1014 if ( c <= 0x0a42 ) return true; 1015 1016 if ( c < 0x0a47 ) return false; 1018 if ( c <= 0x0a48 ) return true; 1019 1020 if ( c < 0x0a4b ) return false; 1022 if ( c <= 0x0a4d ) return true; 1023 1024 if ( c < 0x0a70 ) return false; 1026 if ( c <= 0x0a71 ) return true; 1027 1028 if ( c < 0x0a81 ) return false; 1030 if ( c <= 0x0a83 ) return true; 1031 1032 if ( c == 0x0abc ) return true; 1034 1035 if ( c < 0x0abe ) return false; 1037 if ( c <= 0x0ac5 ) return true; 1038 1039 if ( c < 0x0ac7 ) return false; 1041 if ( c <= 0x0ac9 ) return true; 1042 1043 if ( c < 0x0acb ) return false; 1045 if ( c <= 0x0acd ) return true; 1046 1047 if ( c < 0x0b01 ) return false; 1049 if ( c <= 0x0b03 ) return true; 1050 1051 if ( c == 0x0b3c ) return true; 1053 1054 if ( c < 0x0b3e ) return false; 1056 if ( c <= 0x0b43 ) return true; 1057 1058 if ( c < 0x0b47 ) return false; 1060 if ( c <= 0x0b48 ) return true; 1061 1062 if ( c < 0x0b4b ) return false; 1064 if ( c <= 0x0b4d ) return true; 1065 1066 if ( c < 0x0b56 ) return false; 1068 if ( c <= 0x0b57 ) return true; 1069 1070 if ( c < 0x0b82 ) return false; 1072 if ( c <= 0x0b83 ) return true; 1073 1074 if ( c < 0x0bbe ) return false; 1076 if ( c <= 0x0bc2 ) return true; 1077 1078 if ( c < 0x0bc6 ) return false; 1080 if ( c <= 0x0bc8 ) return true; 1081 1082 if ( c < 0x0bca ) return false; 1084 if ( c <= 0x0bcd ) return true; 1085 1086 if ( c == 0x0bd7 ) return true; 1088 1089 if ( c < 0x0c01 ) return false; 1091 if ( c <= 0x0c03 ) return true; 1092 1093 if ( c < 0x0c3e ) return false; 1095 if ( c <= 0x0c44 ) return true; 1096 1097 if ( c < 0x0c46 ) return false; 1099 if ( c <= 0x0c48 ) return true; 1100 1101 if ( c < 0x0c4a ) return false; 1103 if ( c <= 0x0c4d ) return true; 1104 1105 if ( c < 0x0c55 ) return false; 1107 if ( c <= 0x0c56 ) return true; 1108 1109 if ( c < 0x0c82 ) return false; 1111 if ( c <= 0x0c83 ) return true; 1112 1113 if ( c < 0x0cbe ) return false; 1115 if ( c <= 0x0cc4 ) return true; 1116 1117 if ( c < 0x0cc6 ) return false; 1119 if ( c <= 0x0cc8 ) return true; 1120 1121 if ( c < 0x0cca ) return false; 1123 if ( c <= 0x0ccd ) return true; 1124 1125 if ( c < 0x0cd5 ) return false; 1127 if ( c <= 0x0cd6 ) return true; 1128 1129 if ( c < 0x0d02 ) return false; 1131 if ( c <= 0x0d03 ) return true; 1132 1133 if ( c < 0x0d3e ) return false; 1135 if ( c <= 0x0d43 ) return true; 1136 1137 if ( c < 0x0d46 ) return false; 1139 if ( c <= 0x0d48 ) return true; 1140 1141 if ( c < 0x0d4a ) return false; 1143 if ( c <= 0x0d4d ) return true; 1144 1145 if ( c == 0x0d57 ) return true; 1147 1148 if ( c == 0x0e31 ) return true; 1150 1151 if ( c < 0x0e34 ) return false; 1153 if ( c <= 0x0e3a ) return true; 1154 1155 if ( c < 0x0e47 ) return false; 1157 if ( c <= 0x0e4e ) return true; 1158 1159 if ( c == 0x0eb1 ) return true; 1161 1162 if ( c < 0x0eb4 ) return false; 1164 if ( c <= 0x0eb9 ) return true; 1165 1166 if ( c < 0x0ebb ) return false; 1168 if ( c <= 0x0ebc ) return true; 1169 1170 if ( c < 0x0ec8 ) return false; 1172 if ( c <= 0x0ecd ) return true; 1173 1174 if ( c < 0x0f18 ) return false; 1176 if ( c <= 0x0f19 ) return true; 1177 1178 if ( c == 0x0f35 ) return true; 1180 1181 if ( c == 0x0f37 ) return true; 1183 1184 if ( c == 0x0f39 ) return true; 1186 1187 if ( c == 0x0f3e ) return true; 1189 1190 if ( c == 0x0f3f ) return true; 1192 1193 if ( c < 0x0f71 ) return false; 1195 if ( c <= 0x0f84 ) return true; 1196 1197 if ( c < 0x0f86 ) return false; 1199 if ( c <= 0x0f8b ) return true; 1200 1201 if ( c < 0x0f90 ) return false; 1203 if ( c <= 0x0f95 ) return true; 1204 1205 if ( c == 0x0f97 ) return true; 1207 1208 if ( c < 0x0f99 ) return false; 1210 if ( c <= 0x0fad ) return true; 1211 1212 if ( c < 0x0fb1 ) return false; 1214 if ( c <= 0x0fb7 ) return true; 1215 1216 if ( c == 0x0fb9 ) return true; 1218 1219 if ( c < 0x20d0 ) return false; 1221 if ( c <= 0x20dc ) return true; 1222 1223 if ( c == 0x20e1 ) return true; 1225 1226 if ( c < 0x302a ) return false; 1228 if ( c <= 0x302f ) return true; 1229 1230 if ( c == 0x3099 ) return true; 1232 1233 if ( c == 0x309a ) return true; 1235 1236 return false; 1237 } 1238 1239 1240 1243 public static boolean isXMLDigit (int c) { 1244 if ( c < 0x0030 ) return false; 1246 if ( c <= 0x0039 ) return true; 1247 1248 if ( c < 0x0660 ) return false; 1250 if ( c <= 0x0669 ) return true; 1251 1252 if ( c < 0x06f0 ) return false; 1254 if ( c <= 0x06f9 ) return true; 1255 1256 if ( c < 0x0966 ) return false; 1258 if ( c <= 0x096f ) return true; 1259 1260 if ( c < 0x09e6 ) return false; 1262 if ( c <= 0x09ef ) return true; 1263 1264 if ( c < 0x0a66 ) return false; 1266 if ( c <= 0x0a6f ) return true; 1267 1268 if ( c < 0x0ae6 ) return false; 1270 if ( c <= 0x0aef ) return true; 1271 1272 if ( c < 0x0b66 ) return false; 1274 if ( c <= 0x0b6f ) return true; 1275 1276 if ( c < 0x0be7 ) return false; 1278 if ( c <= 0x0bef ) return true; 1279 1280 if ( c < 0x0c66 ) return false; 1282 if ( c <= 0x0c6f ) return true; 1283 1284 if ( c < 0x0ce6 ) return false; 1286 if ( c <= 0x0cef ) return true; 1287 1288 if ( c < 0x0d66 ) return false; 1290 if ( c <= 0x0d6f ) return true; 1291 1292 if ( c < 0x0e50 ) return false; 1294 if ( c <= 0x0e59 ) return true; 1295 1296 if ( c < 0x0ed0 ) return false; 1298 if ( c <= 0x0ed9 ) return true; 1299 1300 if ( c < 0x0f20 ) return false; 1302 if ( c <= 0x0f29 ) return true; 1303 1304 return false; 1305 } 1306 1307 1308 1311 public static boolean isXMLExtender (int c) { 1312 if ( c == 0x00b7 ) return true; 1314 1315 if ( c == 0x02d0 ) return true; 1317 1318 if ( c == 0x02d1 ) return true; 1320 1321 if ( c == 0x0387 ) return true; 1323 1324 if ( c == 0x0640 ) return true; 1326 1327 if ( c == 0x0e46 ) return true; 1329 1330 if ( c == 0x0ec6 ) return true; 1332 1333 if ( c == 0x3005 ) return true; 1335 1336 if ( c < 0x3031 ) return false; 1338 if ( c <= 0x3035 ) return true; 1339 1340 if ( c < 0x309d ) return false; 1342 if ( c <= 0x309e ) return true; 1343 1344 if ( c < 0x30fc ) return false; 1346 if ( c <= 0x30fe ) return true; 1347 1348 return false; 1349 } 1350 1351 1352 1353 1356 public static boolean isXMLNCNameChar (int c) { 1357 return ( ( isXMLLetter (c) ) 1358 || ( isXMLDigit (c) ) 1359 || ( c == '.' ) 1360 || ( c == '-' ) 1361 || ( c == '_' ) 1362 || ( isXMLCombiningChar (c) ) 1363 || ( isXMLExtender (c) ) ); 1364 } 1365 1366 1369 public static boolean isXMLNCNameStartChar (int c) { 1370 return ( ( isXMLLetter (c) ) 1371 || ( c == '_' ) ); 1372 } 1373 1374 1375 1378 public static boolean isXMLPubidLiteral (char c) { 1379 1382 if ( c == ' ' ) return true; 1384 1385 if ( c == '\r' ) return true; 1387 1388 if ( c == '\n' ) return true; 1390 1391 if ( c == '-' ) return true; 1393 1394 if ( c == '\'' ) return true; 1396 1397 if ( c == '(' ) return true; 1399 1400 if ( c == ')' ) return true; 1402 1403 if ( c == '+' ) return true; 1405 1406 if ( c == ',' ) return true; 1408 1409 if ( c == '.' ) return true; 1411 1412 if ( c == '/' ) return true; 1414 1415 if ( c == ':' ) return true; 1417 1418 if ( c == '=' ) return true; 1420 1421 if ( c == '?' ) return true; 1423 1424 if ( c == ';' ) return true; 1426 1427 if ( c == '!' ) return true; 1429 1430 if ( c == '*' ) return true; 1432 1433 if ( c == '#' ) return true; 1435 1436 if ( c == '@' ) return true; 1438 1439 if ( c == '$' ) return true; 1441 1442 if ( c == '_' ) return true; 1444 1445 if ( c == '%' ) return true; 1447 1448 if ( c < '0' ) return false; 1450 if ( c <= '9' ) return true; 1451 1452 if ( c < 'A' ) return false; 1454 if ( c <= 'Z' ) return true; 1455 1456 if ( c < 'a' ) return false; 1458 if ( c <= 'z' ) return true; 1459 1460 return false; 1461 } 1462 1463} 1464 | Popular Tags |