Hi Jesse, I also understood that the DOM parses uses SAX internally. But is it possible to 'override' this in some way? What I mean is, once I find the element I am interested in (using SAX), can I create a DOM parser that uses that very same SAX parser instance (instead of creating it's own) and starts parsing at the 'current' SAX element and stops parsing at the end of the element?
Thanks, Patrick On 8/03/2007 16:29, Jesse Pelton wrote: > I should think so. The DOM parser creates the entire tree this way; I'd > think you could wait for SAX to present the element you're looking for, > then use standard DOM create...() functions to build your tree from > there. Your parser would need to keep track of its present state (am I > parsing something that needs to go into the DOM, and if so, where in the > tree am I?). > > Of course, DOM is not particularly space-efficient, so a native > representation of the data would be better if that's an option. > > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Rotsaert > Sent: Thursday, March 08, 2007 10:20 AM > To: [email protected] > Subject: SAX and DOM > > Hi all, > > Is it possible to parse a XML file using SAX and create a DOM tree of a > part of the file? > > Thanks, > Patrick > >
