RE: PerlSax to parse/search large (~350 MB) file
by Corey Smith (s) other posts by this author
Jul 11 2001 1:37PM messages near this date
view in the new Beta List Site
RE: XML::Simple - how to iterate through records?
|
XPath seems slow - what am I doing wrong?
Thanks Matt. I understand. What about the XML::Parse::PerlSax Locator
interface, the Locale option, or the location method? Are these things at
all related to what I'm trying to do? If so, does anyone know of a good
resource to learn more about how to implement? Thanks again.
Corey
> -----Original Message-----
> From: Matt Sergeant [SMTP:matt@[...].org]
> Sent: Wednesday, July 11, 2001 8:27 AM
> To: Corey Smith (s)
> Cc: 'Sterin, Ilya'; 'perl-xml@listserv.ActiveState.com'
> Subject: RE: PerlSax to parse/search large (~350 MB) file
>
> On Wed, 11 Jul 2001, Corey Smith (s) wrote:
>
> > Let me try this again. Here's a sample line from the xml file I'm
> working
> > with:
> >
> >
> <conDef><name>Influenza</name><code>C12345</code><id>637</id>.............
> .<
> > /condDef>
> >
> > I would like to search the file for the content of the <code> tag. Once
> the
> > code is located, the entire line (everything from <conDef> to
> </conDef>)
> > containing that code will be output. Because the file is large,
> > speed/efficiency is important.
> >
> > Thanks for the response.
>
> You need to do your own state management. Save the conDef, name, and so on
> each time you see it (store it in your handler object somehow - the
> implementation of that is up to you). Then when you get a match, you can
> output everything you've seen so far, set a flag to say you've found the
> match, and output everything else. Then un-set the "match" flag in the
> end_element callback for </conDef>.
>
> --
> <Matt/>
>
> /|| ** Founder and CTO ** ** http://axkit.com/ **
> //|| ** AxKit.com Ltd ** ** XML Application Serving **
> // || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
> // \\| // ** mod_perl news and resources: http://take23.org **
> \\//
> //\> // \>
> _______________________________________________
> Perl-XML mailing list
> Perl-XML@[...].com
> http://listserv.ActiveState.com/mailman/listinfo/perl-xml
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-xml
|