You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by er...@mindspring.com on 2005/08/24 22:08:37 UTC
[OT] Re: xmlparser simple question
Gilbert,
SAX works on an event based model. Memory is not an issue unless *you* are caching information as you receive events in your parser handler.
The parser starts reading the stream. Each time it encounters the beginning of an element or an attribute, or the value of an element or attribute, or the end of an element or attribute, it simply fires an event. Your parser handler receives the event. At that point, the parser forgets that part of the stream and moves on to the next part. At any one time, the most it's going to cache is a single element or attribute name or value.
I'm not sure though what you mean by "add the root in the parsing processing". Perhaps you could explain further.
Erik
-----Original Message-----
From: "Gilbert, Antoine" <AG...@korem.com>
Sent: Aug 24, 2005 3:59 PM
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: xmlparser simple question
Hi
I want to read an xml file using a SAXReader combined with a
ParserHandler. The file have n o XML root, so I have to find how to add
it in the parsing processing. Assuming that the file can be pretty big,
how I can do it without at any time having the entire file in memory ?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org