Re: Xpath

Liam R E Quin <[email protected]> Sun, 09 Dec 2012 23:33:52 -0500
Newsgroups gmane.comp.lang.perl.xml
Organization W3C - World Wide Web Consortium
Message-ID <[email protected]>
On Sun, 2012-12-09 at 19:18 -0800, Osman Koyuncu wrote:
> I need further advise from you guys in terms of which perl module is most 
> suitable for this work.
> What I am trying to do is to parse an existing xml and generate another xml by 
> processing a subset of elements and consoliating some others.

Use XSLT for this (or possibly XQuery, but XSLT is better known and
already supported both in Perl and everywhere else :-)

You can run XSLT from within Perl, or standalone (e.g. on Windows you
might use Saxon, which implements XSLT 2, or libxml's xsltproc, which
implements the much much older XSLT 1 which is also found in Web
browsers, python, Perl, PHP, COBOL, etc :-)

If it is a large XML document - gigabytes, say - and you need to process
it more often than it changes, or if you need sub-millisecond
performance, you should look into XQuery instead. But don't worry about
speed in the first instance, worry about something that can be
maintained easily.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Co-author: 5th edition of "Beginning XML" - Wrox, July 2012

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs