Skip Menu |

This queue is for tickets about the MARC-XML CPAN distribution.

Report information
The Basics
Id: 83284
Status: resolved
Priority: 0/
Queue: MARC-XML

People
Owner: GMCHARLT [...] cpan.org
Requestors: DBWELLS [...] cpan.org
Cc: dbwells [...] gmail.com
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.0
Fixed in: 1.0.1



CC: dbwells [...] gmail.com
Subject: New decode() fails on completely empty records
This may be a "won't fix" type of bug, but since I hit it, I'll let the maintainer decide. If you have a <record /> tag with nothing in it, decode dies with 'Can't call method "textContent" on an undefined value at /usr/local/share/perl/5.10.1/MARC/File/XML.pm line 456.' (where it tries to peek at the leader, which doesn't exist). The prior version (0.93) happily returned an empty MARC::Record object instead of dying.
On Tue Feb 12 13:31:14 2013, DBWELLS wrote: Show quoted text
> This may be a "won't fix" type of bug, but since I hit it, I'll let the > maintainer decide. > > If you have a <record /> tag with nothing in it, decode dies with 'Can't > call method "textContent" on an undefined value at > /usr/local/share/perl/5.10.1/MARC/File/XML.pm line 456.' (where it tries > to peek at the leader, which doesn't exist). The prior version (0.93) > happily returned an empty MARC::Record object instead of dying.
Summarizing our discussion in IRC just now, since an empty record element (that has a namespace declaration) is accepted as valid per http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd, I'll restore the prior behavior of returning an empty MARC::Record.
I've made a patch for this. If you care to take a look before I do another release of MARC::File::XML, check out the rt83284 branch of git://git.code.sf.net/p/marcpm/code.
Tested, works perfectly. Thank you! On Wed Feb 13 00:46:29 2013, GMCHARLT wrote: Show quoted text
> I've made a patch for this. If you care to take a look before I do > another release of > MARC::File::XML, check out the rt83284 branch of > git://git.code.sf.net/p/marcpm/code.