From a0caeaca0c8555a7a3360cd484d11f0b8bf436f6 Mon Sep 17 00:00:00 2001 From: Jens Steidl <Jens.Steidl@slub-dresden.de> Date: Fri, 9 Apr 2021 14:14:43 +0200 Subject: [PATCH] - improved parameter check --- bin/slubsipbuilderbagit.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl index d217e3d..5d99a91 100644 --- a/bin/slubsipbuilderbagit.pl +++ b/bin/slubsipbuilderbagit.pl @@ -222,7 +222,7 @@ package SLUB::LZA::SIPBuilderBagIt; } sub add_marc21_schema_location($) { - if(! defined $_[0]) { croak "marc xml document required!"; } + if(ref($_[0]) ne 'XML::LibXML::Document') { croak "marc xml document required!"; } my $marc_doc = $_[0]; my $root = $marc_doc->findnodes('/*[local-name()="record"]')->[0]; # get root element (XML::LibXML::Element) $root->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); # add xsi namespace (simple) -- GitLab