Skip to Content.
Sympa Menu

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

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: John Cowan <cowan AT mercury.ccil.org>
  • Cc: xom-interest AT lists.ibiblio.org
  • 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 metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page