X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXXml.pm;h=fe4cb2b8af8efc6affdc47079922e6f56f25e3c5;hb=f84b188c092d48648c16f3174b293b32d8f5bd6a;hp=a351510c511f02ca0f8ce450bb3d3906c39f61c1;hpb=6d1745603b0d1bb463194999129713c978f4244f;p=spider.git diff --git a/perl/DXXml.pm b/perl/DXXml.pm index a351510c..fe4cb2b8 100644 --- a/perl/DXXml.pm +++ b/perl/DXXml.pm @@ -41,11 +41,17 @@ sub init { return unless $main::do_xml; - eval { require XML::Simple; }; - unless ($@) { + eval { require XML::Simple }; + eval { require XML::SAX } unless $@; + eval { require XML::SAX::Expat } unless $@; + if ($@) { + LogDbg('err', "do_xml was set to 1 and the XML routines failed to load ($@)"); + $main::do_xml = 0; + } else { + $XML::Simple::PREFERRED_PARSER = 'XML::SAX::Expat'; import XML::Simple; $DXProt::handle_xml = 1; - $xs = new XML::Simple(); + $xs = new XML::Simple(Cache=>[]); } undef $@; }