[jdom-commits] CVS Update:
jdom-contrib/src/java/org/jdom/contrib/input/scanner
Jason Hunter
jhunter at servlets.com
Tue Aug 31 13:53:02 PDT 2004
****************************************
Date: Tue Aug 31, 2004 @13:53:02 PDT
Author:
Update of /home/cvs/jdom-contrib/src/java/org/jdom/contrib/input/scanner
In directory servlets:/tmp/cvs-serv8506
Modified Files:
ElementScanner.java
Log Message:
Patch from Laurent based on a problem report by Richard Allen.
--
Hi Richard,
Sorry for the long delay. I had a chance to look at your problem.
Indeed, this is a problem in ElementScanner and your analysis is correct.
> To fix, I removed the if (this.activeRules.size() != 0) test that contained
> the startElement() call to XMLScanner, so that it always propogates the
> event to the SAXHandler.
Your fix proposal to always propagate the startElement events to
SAXHandler is quite dangerous as it forces SAXHandler to build a
full JDOM document from the parser output (which is précisely what
ElementScanner aims at avoiding).
Thus, I think we should keep the "if (this.activeRules.size() != 0)"
test to support extracting some nodes from huge document while using
as little memory as possible.
Attached is another patch proposal: Instead of directly using SAXHandler,
it relies on a subclass (FragmentHandler, borrowed from JDOMResult) that
inserts a dummy root document in SAXHandler's document.
This guarantees that, whatever your matching rules, SAXHandler will
always have a single root document.
--
-jh-
===================================================================
File: no file ElementScanner.java Status: Needs Checkout
Working revision: 1.12 Tue Aug 31 20:53:02 2004
Repository revision: 1.12 /home/cvs/jdom-contrib/src/java/org/jdom/contrib/input/scanner/ElementScanner.java,v
Existing Tags:
jdom_1_0_b10 (revision: 1.10)
jdom_1_0_b10_rc1 (revision: 1.10)
jdom_1_0_b9 (revision: 1.5)
More information about the jdom-commits
mailing list