X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FRecord.pm;h=1ab5033308245ee4b9c1aa0dfe5da7c3ca4a1b1c;hb=8db258f86776ee4d7049c59e81c319f05cd292fc;hp=081e19d064f4db4971263ad3817806109be76101;hpb=d279b72e4e1af82605815866f0f52a40328531bf;p=irspy-moved-to-github.git diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index 081e19d..1ab5033 100644 --- a/lib/ZOOM/IRSpy/Record.pm +++ b/lib/ZOOM/IRSpy/Record.pm @@ -1,4 +1,4 @@ -# $Id: Record.pm,v 1.11 2006-09-25 12:39:34 mike Exp $ +# $Id: Record.pm,v 1.13 2006-09-26 09:08:09 mike Exp $ package ZOOM::IRSpy::Record; @@ -6,6 +6,9 @@ use 5.008; use strict; use warnings; +use Exporter 'import'; +our @EXPORT_OK = qw(xml_encode); + use XML::LibXML; use XML::LibXML::XPathContext; @@ -26,7 +29,7 @@ I<## To follow> sub new { my $class = shift(); - my($target, $zeerex) = @_; + my($irspy, $target, $zeerex) = @_; if (!defined $zeerex) { $zeerex = _empty_zeerex_record($target); @@ -34,6 +37,7 @@ sub new { my $parser = new XML::LibXML(); return bless { + irspy => $irspy, target => $target, parser => $parser, zeerex => $parser->parse_string($zeerex)->documentElement(), @@ -101,8 +105,8 @@ sub append_entry { if @nodes == 0; } - ZOOM::Log::log("irspy", - scalar(@nodes), " matches for '$xpath': using first") + $this->{irspy}->log("irspy", + scalar(@nodes), " matches for '$xpath': using first") if @nodes > 1; $this->_half_decent_appendWellBalancedChunk($nodes[0], $frag);