[jdom-interest] Verifier

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Apr 4 05:19:29 PST 2002

At 5:18 PM -0800 4/1/02, Jason Hunter wrote:

>>  1.  Unless there is some reason anyone can see against it, I think most of
>>  the methods in Verifier, such as isXMLLetter, isXMLDigit, and
>>  isXMLCombiningChar, should be using the Character.Subset interface defined
>>  in java.lang, as this is the standard way to define ranges of characters for
>>  Java.  This won't help performance (shouldn't really hurt it either), but it
>>  will make it a bit more standard.
>I'd be interested in hearing Elliotte's thoughts on this.  Lacking his
>commentary, I personally think it's better to match the XML spec
>explicitly than to rely on Java's built-in behaviors.

We could define our own subclasses of Character.Subset that matched 
XML's rules.  Since XML doesn't match Unicode exactly, we couldn't 
use the preexisting rules in the JDK as I think Jason originally 
pointed out over two years ago. (The original version of Verifier I 
wrote did use the Java methods.)

I really don't think Character.Subset would gain us anything at all, 
and it would needlessly restrict us to Java 1.2 and later. I 
recommend staying with the current implementation. Is there some 
particular use-case you had in mind that would call for using 

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list