[OPEN-ILS-GENERAL] unAPI from getAttribute in WWW/SuperCat.pm?

John Merriam jmerriam at biblio.org
Tue Jan 2 09:50:27 EST 2018


Hello.  I am working in the perl module WWW/SuperCat.pm and trying to 
get the id of a row in asset.copy.  For some reason I am getting back 
what looks like an unAPI URI instead of just the id of the row.  I've 
been staring at this for a while and not sure why this is happening or 
the best way to fix it.  This is around line 2030 in my WWW/SuperCat.pm 
in EG 2.12.8.  The basic code flow in WWW/SuperCat.pm is:

results retrieved from cstore
my $marcxml = XML::LibXML->load_xml(...);
my @copies;
for my $node ($marcxml->getElementsByTagName('holdings')) {
   for my $volume ($node->getElementsByTagName('volume')) {
     for my $copy ($volume->getElementsByTagName('copy')) {
       push @copies, {
         f => $copy->getAttribute('id'),
       };

f ends up with unAPI stuff in it instead of just the row id that I am 
looking for.  It looks like:

ftag:open-ils.org:U2 at acp/5826234

The part that I want is after the /   I put in a hack to manipulate the 
unAPI string and strip out the / and everything in front of it but I 
don't want to leave it that way.  I would like to do this the correct way.

I'm not sure if it really is supposed to behave this way or not. 
Assuming it is, I was thinking maybe a function exists that can extract 
the row id from the unAPI URI?  I wasn’t able to find one.

Any ideas how to correctly get just the real row id from the database 
without the unAPI stuff?

Thanks in advance!

-- 

John Merriam
Evergreen System Specialist
Bibliomation, Inc.
24 Wooster Ave.
Waterbury, CT 06708
203-577-4070 x108


More information about the Open-ils-general mailing list