XML parser

B

Bart van den Burg

Hi

I'm in need of a very basic XML parser. All it has to do is read an XML file
and put all the data in a variable (hash reference?)

I tested to XML parsers, XML::Simple and XML::Smart on an XML file of 7110
bytes. The difference is quite big:

perl -e 'use Time::HiRes qw(gettimeofday tv_interval); my $t0 =
[gettimeofday]; use XML::Smart; XML::Smart->new("englishiso.xml"); my $t1 =
[gettimeofday]; print "XML::Smart: ". tv_interval($t0, $t1)."\n"; $t0 =
[gettimeofday]; use XML::Simple; XMLin("english.xml"); print "XML::Simple:
".tv_interval($t0, [gettimeofday])."\n"'
XML::Smart: 0.093696
XML::Simple: 0.6697

The reason I had to use 2 different xml files is that XML::Simple doesn't
support iso-8859-1 as encoding before version 5.7.2 and I'm running 5.6.1,
and XML::Smart gives me an error when I try to let it parse a document with
encoding ASCII (I need iso-8859-1 anyway, so that means XML::Simple is out
of the question at this point)

XML::Smart is way too slow for me, and XML::Simple is actually quite okay,
but now I'm wondering which other XML I could test, cause i want the fastest
out there, without it being too advanced. It's for a website (it's language
files), and it's opened once every time a page is requested

Which ones could I try?

thanks
Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top