Re: XML::XPath to read multiple files

Tod Harter <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Yeah, I have to agree. LibXML is a pretty fast library and is going to do
the job faster than alternative modules. The XPath statements that you use
may also be a factor. There are many ways to structure an XPath selector and
some may be MUCH more efficient than others. If switching to LibXML by
itself doesn't give you the speed increase you want then you may want to
consider exactly how you're doing things.

For example if a document has a bunch of data you want to extract which you
know is in a particular portion of the document its going to be a LOT faster
in general to select a node that is guaranteed to be the parent of the stuff
you want and is the closest point in the document tree you can get. This
might exclude a lot of searching of irrelevant data.

On Mon, Oct 19, 2009 at 2:02 PM, mirod <[email protected]> wrote:

> Robert Inder wrote:
> > I am trying to extend an application that uses XML::XPath to extract
> > fragments of information from a small XML file.
> >
> > The extension will cause it to summarise this information from
> > MANY XML files.  Doing the obvious thing gets me a working
> > system, but it is slow.
> >
> > Currently, I am analysing each file in turn using the existing
> information
> > extraction code, and ths is creating an XML::XPath object to do the
> business.
>
> I guess this bears repeating: ditch XML::XPath and use XML::LibXML, the
> code
> will be nearly identical, and you will live much happier.
>
> --
> mirod
> _______________________________________________
> Perl-XML mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>



-- 
The Wise adapts himself to the world. The Fool adapts the world to himself.
Therefore, all progress depends on the Fool.

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.