Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Optimizing character checking

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT>
  • To: John Cowan <cowan AT>
  • Cc: xom-interest AT
  • Subject: Re: [XOM-interest] Optimizing character checking
  • Date: Mon, 12 May 2003 09:28:01 -0400

At 8:35 AM -0400 5/12/03, John Cowan wrote:
Elliotte Rusty Harold scripsit:

private static boolean isXMLCharacter(int c) {

if (c <= 0xD7FF) {
if (c >= 0x20) return true;
else {
if (c == '\n') return true;
if (c == '\r') return true;
if (c == '\t') return true;
return false;

I recommend creating a static boolean array to handle the characters less
than 0x20.

So replace the else clause with something like

return array[c]


Possible. I'll try it out and see how it performs.


Elliotte Rusty Harold
elharo AT
Processing XML with Java (Addison-Wesley, 2002)

Archive powered by MHonArc 2.6.24.

Top of Page