Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] More parsing performance patches

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] More parsing performance patches
  • Date: Fri, 22 Jul 2005 07:42:51 -0400

Wolfgang Hoschek wrote:

private static final String[] CRLF_SP;
private static final String[] LF_SP;
private static final String[] SPACES;

private static final String[] CRLF_TAB;
private static final String[] LF_TAB;
private static final String[] TABS;


Do you really need the carriage returns here? The XML parser is going to normalize all carriage returns and carriage return/linefeed pairs in the input document to linefeeds when parsing. A carriage return is only gong to appear if the user has used a numeric character reference to specially insert a carriage return. That does happen but it's quite uncommon. I suspect you'd be safe (and the code simpler) if it only recognized raw linefeeds as a line break,

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page