From: Roedy Green on
It seems to me the usual XML tools in Java load the entire XML file
into RAM. Are there any tools that process sequentially, bringing in
only a chunk at a time so you could handle really fat files.
--
Roedy Green Canadian Mind Products
http://mindprod.com

Every compilable program in a sense works. The problem is with your unrealistic expections on what it will do.
From: John B. Matthews on
In article <3qvtm5h7bf92h7nos1nms4oc4m6cd203d6(a)4ax.com>,
Roedy Green <see_website(a)mindprod.com.invalid> wrote:

> It seems to me the usual XML tools in Java load the entire XML file
> into RAM. Are there any tools that process sequentially, bringing in
> only a chunk at a time so you could handle really fat files.


I thought that was a principal advantage of the Simple API For XML (SAX)
model, at least in principle. :-)

<http://www.totheriver.com/learn/xml/xmltutorial.html>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
From: Peter Duniho on
Roedy Green wrote:
> It seems to me the usual XML tools in Java load the entire XML file
> into RAM. Are there any tools that process sequentially, bringing in
> only a chunk at a time so you could handle really fat files.

Sounds like you want the XMLStreamReader interface:
http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html

I haven't used the Java version myself (there's a similar type in .NET),
and haven't looked closed to determine the specifics. But I presume
there's a way to get an implementation of the interface (looks like
XMLInputFactory is the way to go).

Of course, if per a previous discussion you're stuck on Java 1.5, this
is unavailable to you. But otherwise, you should find it exactly what
you're asking for.

Pete
From: Donkey Hottie on
On 7.2.2010 19:59, Roedy Green wrote:
> It seems to me the usual XML tools in Java load the entire XML file
> into RAM. Are there any tools that process sequentially, bringing in
> only a chunk at a time so you could handle really fat files.

Java has tools for such XML files. SAX processes XML so that it does not
need to load it all to memory.

--
Good day for a change of scene. Repaper the bedroom wall.
From: Donkey Hottie on
On 7.2.2010 20:14, Peter Duniho wrote:
> Roedy Green wrote:
>> It seems to me the usual XML tools in Java load the entire XML file
>> into RAM. Are there any tools that process sequentially, bringing in
>> only a chunk at a time so you could handle really fat files.
>
> Sounds like you want the XMLStreamReader interface:
> http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html
>
> I haven't used the Java version myself (there's a similar type in .NET),
> and haven't looked closed to determine the specifics. But I presume
> there's a way to get an implementation of the interface (looks like
> XMLInputFactory is the way to go).
>
> Of course, if per a previous discussion you're stuck on Java 1.5, this
> is unavailable to you. But otherwise, you should find it exactly what
> you're asking for.
>
> Pete

SAX interface works fine even with Java 1.4, and it does what Roedy wants.


--
Good day for a change of scene. Repaper the bedroom wall.