Java Mailing List Archive

http://www.junlu.com/

Google Search
Google


Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
SV: [jdom-interest] JDOM and very large files

SV: [jdom-interest] JDOM and very large files

2003-10-10       - By Per Norrman

 Back
Hi,

Actually, the file (or input stream) is read sequentially,
but, as you say, the entire document tree is built in memory;
and this is usually much larger than the text represntation.

You can use SAX directly and bypass the tree building step.
This maybe a bit awkward if you are unfamiliar with its
callback mechanism, but it should work well for simple
processing.

Another allternative is the new StAX API (Streaming API for XML).
Here is an introduction, http://www.xml.com/pub/a/2003/09/17/stax.html,
with pointers to a reference implementation.

Also, there is of course lots of PERL implementations
out there, but you'll have to ask someone else about
their usefulness. I once had to maintain a PERL thingy
which manipulated a large XML file; since then me and PERL
has an agreement not to come closer than 100 yards of each
other.

/pmn


> -- --Ursprungligt meddelande-- --
> Fr?n: jdom-interest-admin@(protected)
> [mailto:jdom-interest-admin@(protected)] F?r Daryl Handley
> Skickat: den 10 oktober 2003 07:08
> Till: jdom-interest@(protected)
> ?mne: [jdom-interest] JDOM and very large files
>
>
> Hi everyone,
>
> I am trying to parse a very large file (1.3 Gb) using JDOM. I
> have used JDOM before with smaller files, but never large
> ones. It seems like the builder attempts to read the whole
> file into memory and build the document. Is there a way to
> read only part of the document into memory ? I only beed to
> read through the file sequentially, random access to parts of
> the doc is not important. Does anyone have any suggestions
> how to do this with JDOM ? Java in general ? Any other language ?
>
> Otherwise I may have to write my own parser to do it in PERL.
> The document structure is fairly simple (just huge) so this
> shouldn't be too hard, but I would prefer to do it with JDOM
> if possible.
>
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr@(protected)

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
.com



Earn $52 per hosting referral at Lunarpages.
©2008 junlu.com - Jax Systems, LLC, U.S.A.