[
Lists Home |
Date Index |
Thread Index
]
James:
> Does anyone know of a Perl XML parser?
> I want to transform my XML/XSLT on the Server side
XML::Parser is the granddaddy of them all. If all you need is simple parsing try
XML::Simple which sits on top of it, for basic parsing. AxKit was also mentiond
(but needs mod_perl). XML::Parser uses a native C library under the covers.
There are versions of SAX and XML::Simple that are pure perl based, but of
course this means you will take an even bigger performance hit.
Go to CPAN and search on XML and XSLT....you'll find a heap of pre-written
packages there.
I just recently did this exact same thing. Easily done...but there are some big
caveats you need to be aware of:
1) If you are not hosting your own server (ie. using an ISP) then you may need
to get them to install whatever you select. Or pick a solution that is pure Perl
(eg. no C routines) which you can install yourself (and prepare for the
performance hit).
2) Performance will suck big time....unless you implement under mod_perl. For
example...I was going to use XML for config files for my CGI scripts....but it
added a huge overhead to the CGI script startup that was not worth it. (As an
aside, what I did was still put the configs in XML format...but then ran a
transform that converted the XML config into a native Perl executable script,
which is then used at runtime....way lower overhead). If this will be a heavily
used app, every time your CGI gets hit, the web server/perl combo will have to
load all the XML stuff...which takes a long time. mod_perl fixes this by
loading/compiling this stuff only once....but can be tricky to implement and
virtually impossible if you are using an external ISP (hardly any suppport
mod_perl).
Hope this helps....
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com
|