X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FRecord.pm;h=7444d70014bcfb9868ae4fcd8ebb85d0755f8c91;hp=4ba8bb669fcddcefdad7c8bad41d4fd76cfc6f43;hb=7f4706a4bbb2a31f946c17173acef373a672a5b2;hpb=63c7c8da2c3a514daafe08763096319697594378 diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index 4ba8bb6..7444d70 100644 --- a/lib/ZOOM/IRSpy/Record.pm +++ b/lib/ZOOM/IRSpy/Record.pm @@ -1,4 +1,4 @@ -# $Id: Record.pm,v 1.25 2007-05-04 12:09:24 mike Exp $ +# $Id: Record.pm,v 1.28 2007-12-12 08:49:58 mike Exp $ package ZOOM::IRSpy::Record; ### I don't think there's any reason for this to be separate from @@ -82,7 +82,8 @@ sub append_entry { # fully general version would work its way through each # component of the XPath, but for now we just treat it as a # single chunk to go inside the top-level node. - $this->_half_decent_appendWellBalancedChunk($xc, "<$xpath>"); + $this->_half_decent_appendWellBalancedChunk($xc->getContextNode(), + "<$xpath>"); @nodes = $xc->findnodes($xpath); die("still no matches for '$xpath' after creating: can't append") if @nodes == 0; @@ -146,7 +147,12 @@ sub _half_decent_appendWellBalancedChunk { if (1) { $frag =~ s,>, xmlns:irspy="$ZOOM::IRSpy::Utils::IRSPY_NS">,; - $node->appendWellBalancedChunk($frag); + eval { + $node->appendWellBalancedChunk($frag); + }; if ($@) { + print STDERR "died while trying to appendWellBalancedChunk(), probably due to bad XML:\n$frag"; + die $@; + } return; }