X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXXml.pm;h=280d19ced31691e35612880b3b48ee086e297470;hb=006e37a3ce71aa3c55833fade25f9c6c11734bb6;hp=a9072d467d4fcc3ea8e3ea150be2174c3cd749af;hpb=00279dee4d97b67f722b9be52e0d8a9840ed2ef1;p=spider.git diff --git a/perl/DXXml.pm b/perl/DXXml.pm index a9072d46..280d19ce 100644 --- a/perl/DXXml.pm +++ b/perl/DXXml.pm @@ -39,7 +39,7 @@ sub new { my $pkg = shift; my $class = ref $pkg || $pkg; - my $self = bless{@_}, $class; + my $self = bless{}, $class; while (@_) { my $key = shift; my $val = shift; @@ -64,7 +64,7 @@ sub init $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; import XML::Simple; $DXProt::handle_xml = 1; - $xs = new XML::Simple(Cache=>[]); + $xs = new XML::Simple(ContentKey=>'content', ForceArray=>1); } undef $@; } @@ -125,9 +125,9 @@ sub normal $xref->{'-timet'} = $t; return if DXDupe::check("xml,$o,$t,$id", $dupeage); - $xref = bless $xref, $pkg; - $xref->{'-xml'} = $line; - $xref->handle_input($dxchan); + my $r = bless $xref, $pkg; + $r->{'-xml'} = $line; + $r->handle_input($dxchan); } # @@ -269,24 +269,12 @@ sub route if ($dxchan->handle_xml) { $dxchan->send($self->toxml); - } elsif ($dxchan->isnode) { + } elsif ($dxchan->is_node) { my $ref = $self->topcxx($dxchan); - if (ref $ref) { - for (@$ref) { - $dxchan->send($_); - } - } else { - $dxchan->send($ref); - } + $dxchan->send($ref); } else { my $ref = $self->tocmd($dxchan); - if (ref $ref) { - for (@$ref) { - $dxchan->send($_); - } - } else { - $dxchan->send($ref); - } + $dxchan->send($ref); } }