Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > XML parser

Reply
Thread Tools

XML parser

 
 
Bart van den Burg
Guest
Posts: n/a
 
      10-23-2003
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML::Parser Installation error: XML-Parser-2.34 Sean Perl Misc 3 10-03-2006 01:23 AM
XML::Parser Installation error: XML-Parser-2.34 Sean Perl Misc 0 10-02-2006 06:20 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
XML-Parser to XML-Parser communication (encoding issues?) arne Perl Misc 0 09-13-2005 12:53 PM
XML Parser VS HTML Parser ZOCOR Java 11 10-05-2004 01:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57