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



On Feb 15, 4:59 am, uresh.kuruh...@xxxxxxxxx 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


.



Relevant Pages

  • Re: Word 2003 XML
    ... In essence the parser determines whether the XML provided to it, ... have much info. about the schemas associated with an XML document. ... (which is what namespaces are all about). ...
    (microsoft.public.mac.office.word)
  • Re: My Regexp XML Parser -> Structured Perl Data, Cut & Paste Version, No Modules (Vol I)
    ... >>>but that's totally useless for XML parsing. ... >Your parser has no appreciation of nesting beyond the very trivial, ... >going to be for your parser to validate against one. ... Wheather or not I can use it to write a schema checker is something I ...
    (comp.lang.perl.misc)
  • Re: SAX PARSING DESIGN PATTERN
    ... I am parsing out an xml document using a sax parser. ... In the class that implements the parser element for a given tag I include a reference to the parent parser element object. ... The parsing loop will retrieve a handler for the current tag during startElement() and set its "parent" instance variable to the current AbstractHandler before pointing currentHandler at the new one. ... Or does your SAX parser actually have StartElementand EndElementmethods? ...
    (comp.lang.java.programmer)
  • [ANN] XSD/e 1.1.0 - validating XML parser generator for embedded systems
    ... I am pleased to announce the availability of CodeSynthesis XSD/e 1.1.0. ... CodeSynthesis XSD/e is an open-source XML ... parser generator for mobile and embedded systems. ...
    (comp.arch.embedded)
  • [ANN] XSD/e 1.1.0 - validating XML parser generator for embedded systems
    ... I am pleased to announce the availability of CodeSynthesis XSD/e 1.1.0. ... CodeSynthesis XSD/e is an open-source XML ... parser generator for mobile and embedded systems. ...
    (microsoft.public.windowsce.embedded.vc)