jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/dtdparser/XmlChars.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
45 * bits of a UCS-4 character, and pairs of Unicode <em>surrogate |
45 * bits of a UCS-4 character, and pairs of Unicode <em>surrogate |
46 * characters</em> can be combined to encode UCS-4 characters in |
46 * characters</em> can be combined to encode UCS-4 characters in |
47 * documents containing only Unicode. (The <code>char</code> datatype |
47 * documents containing only Unicode. (The <code>char</code> datatype |
48 * in the Java Programming Language represents Unicode characters, |
48 * in the Java Programming Language represents Unicode characters, |
49 * including unpaired surrogates.) |
49 * including unpaired surrogates.) |
50 * <p/> |
50 * <p> |
51 * <P> In XML, UCS-4 characters can also be encoded by the use of |
51 * <P> In XML, UCS-4 characters can also be encoded by the use of |
52 * <em>character references</em> such as <b>&#x12345678;</b>, which |
52 * <em>character references</em> such as <b>&#x12345678;</b>, which |
53 * happens to refer to a character that is disallowed in XML documents. |
53 * happens to refer to a character that is disallowed in XML documents. |
54 * UCS-4 characters allowed in XML documents can be expressed with |
54 * UCS-4 characters allowed in XML documents can be expressed with |
55 * one or two Unicode characters. |
55 * one or two Unicode characters. |
362 // added a character ... |
362 // added a character ... |
363 return c == 0x0387; |
363 return c == 0x0387; |
364 } |
364 } |
365 } |
365 } |
366 |
366 |
367 private static boolean isDigit(char c) { |
|
368 // [88] Digit ::= ... |
|
369 |
|
370 // |
|
371 // java.lang.Character.isDigit is correct from the XML point |
|
372 // of view except that it allows "fullwidth" digits. |
|
373 // |
|
374 return Character.isDigit(c) |
|
375 && !((c >= 0xff10) && (c <= 0xff19)); |
|
376 } |
|
377 |
|
378 private static boolean isExtender(char c) { |
367 private static boolean isExtender(char c) { |
379 // [89] Extender ::= ... |
368 // [89] Extender ::= ... |
380 return c == 0x00b7 || c == 0x02d0 || c == 0x02d1 || c == 0x0387 |
369 return c == 0x00b7 || c == 0x02d0 || c == 0x02d1 || c == 0x0387 |
381 || c == 0x0640 || c == 0x0e46 || c == 0x0ec6 |
370 || c == 0x0640 || c == 0x0e46 || c == 0x0ec6 |
382 || c == 0x3005 || (c >= 0x3031 && c <= 0x3035) |
371 || c == 0x3005 || (c >= 0x3031 && c <= 0x3035) |