From c3e61d206205e535644684941b6c374a23b30c8f Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Thu, 3 Oct 2013 11:17:52 +1300 Subject: [PATCH] Fixing a typo and getting the correct itemnumber now Signed-off-by: Chris Cormack --- lib/NCIP/Handler.pm | 2 +- lib/NCIP/Handler/LookupItem.pm | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/NCIP/Handler.pm b/lib/NCIP/Handler.pm index fc179eb..32367f1 100644 --- a/lib/NCIP/Handler.pm +++ b/lib/NCIP/Handler.pm @@ -26,7 +26,7 @@ sub new { my $namespace = shift; my $type = shift; my $subclass = __PACKAGE__ . "::" . $type; - my $self = bless { type => $type, namspace => $namespace }, $subclass; + my $self = bless { type => $type, namespace => $namespace }, $subclass; return $self; } diff --git a/lib/NCIP/Handler/LookupItem.pm b/lib/NCIP/Handler/LookupItem.pm index fd51551..e931bec 100644 --- a/lib/NCIP/Handler/LookupItem.pm +++ b/lib/NCIP/Handler/LookupItem.pm @@ -28,9 +28,12 @@ sub handle { my $self = shift; my $xmldoc = shift; if ($xmldoc) { + # Given our xml document, lets find the itemid my ($item_id) = - $xmldoc->getElementsByTagNameNS( $self->namespace(), 'ItemId' ); - my $item = NCIP::Item->new( { itemid => $item_id } ); + $xmldoc->getElementsByTagNameNS( $self->namespace(), + 'ItemIdentifierValue' ); + my $item = NCIP::Item->new( { itemid => $item_id->textContent() } ); + warn $item->itemid(); } return $self->type; } -- 2.43.2