XML parser

Discussion in 'Perl Misc' started by Bart van den Burg, Oct 23, 2003.

  1. 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
     
    Bart van den Burg, Oct 23, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ZOCOR

    XML Parser VS HTML Parser

    ZOCOR, Oct 3, 2004, in forum: Java
    Replies:
    11
    Views:
    844
    Paul King
    Oct 5, 2004
  2. arne
    Replies:
    0
    Views:
    377
  3. Erik Wasser
    Replies:
    5
    Views:
    518
    Peter J. Holzer
    Mar 5, 2006
  4. Sean
    Replies:
    3
    Views:
    339
    robic0
    Oct 3, 2006
  5. Sean
    Replies:
    0
    Views:
    392
Loading...

Share This Page