X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=perl%2FDXXml.pm;h=fe4cb2b8af8efc6affdc47079922e6f56f25e3c5;hp=a351510c511f02ca0f8ce450bb3d3906c39f61c1;hb=9cc26cc7a73efb7679d3e8e819ba0019307f8607;hpb=20efba5d5f656113144785e0ef84296e6d2c2e69 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 $@; }