Click here to get back home

how to skip some xml records using XML::SAX parser?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
how to skip some xml records using XML::SAX parser? uresh.kuruhuri 02-15-2007
Posted by uresh.kuruhuri on February 15, 2007, 5:59 am
Please log in for more thread options


Hello All,

I have some performance issue while using the XML::SAX parser. I have
been using this parser for long time.

The problem is, I have a xml file, say >75 MB to parse. It's taking
hell lot of time to parse it. I don't need some of the xml records to
be parsed based on a particular field.

Each xml record is having 24 fields. On checking the first or third
field in the order of the xml record, i want to skip the parsing for
the remaining of the xml record and jump on to the next xml record. By
any chance, is it possible in XML::SAX parser???? If I can do this, I
would really save a significant amount of time in the process.

Also, let me know if the XML::SAX parser takes the DTD for the xml
document?

I remember that the XML::SAX parser reads the xml file line by line so
that more memory is not used up.

Thanks in anticipation.

Regards,
Uresh


Posted by Keith on February 16, 2007, 10:32 am
Please log in for more thread options


On Feb 15, 4:59 am, uresh.kuruh...@gmail.com wrote:
> Hello All,
>
> I have some performance issue while using the XML::SAX parser. I have
> been using this parser for long time.
>
> The problem is, I have a xml file, say >75 MB to parse. It's taking
> hell lot of time to parse it. I don't need some of the xml records to
> be parsed based on a particular field.
>
> Each xml record is having 24 fields. On checking the first or third
> field in the order of the xml record, i want to skip the parsing for
> the remaining of the xml record and jump on to the next xml record. By
> any chance, is it possible in XML::SAX parser???? If I can do this, I
> would really save a significant amount of time in the process.
>
> Also, let me know if the XML::SAX parser takes the DTD for the xml
> document?
>
> I remember that the XML::SAX parser reads the xml file line by line so
> that more memory is not used up.
>
> Thanks in anticipation.
>
> Regards,
> Uresh

One of the few things I defer to Java for over Perl, personally, is
XML parsing.
It just seems to work better, faster, more reliably, and is better
supported,
IMHO with third-party free-(as in beer)-ware.

So you have me at a disadvantage, but Perl likely supports XPATH,
which is a way
to parse the XML tree in your document selectively. O'Reilly's "Java
& XML" has
very helpful examples, I don't know how well they'd translate to a
Perl approach.

HTH,

Keith



Similar ThreadsPosted
skip path prune July 17, 2006, 12:34 pm
Need Help with XML::Parser July 5, 2005, 12:53 pm
X500::DN::Parser V 1.16 July 29, 2004, 7:20 am
Can not Install XML::Parser September 29, 2004, 5:26 pm
How to use SGML::Parser? August 2, 2005, 5:18 pm
Possible bug in HTML::Parser November 15, 2005, 5:05 pm
Installing XML Parser May 25, 2006, 2:20 am
XML file parser April 4, 2007, 8:33 pm
RFC on module name: MMS::Parser November 10, 2007, 11:18 pm
Help Compiling XML::Parser On AIX 5.2 64bit September 18, 2005, 9:57 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap