Skip to content
Snippets Groups Projects
Commit a0caeaca authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

- improved parameter check

parent a68fa8fd
No related branches found
No related tags found
No related merge requests found
...@@ -222,7 +222,7 @@ package SLUB::LZA::SIPBuilderBagIt; ...@@ -222,7 +222,7 @@ package SLUB::LZA::SIPBuilderBagIt;
} }
sub add_marc21_schema_location($) { 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 $marc_doc = $_[0];
my $root = $marc_doc->findnodes('/*[local-name()="record"]')->[0]; # get root element (XML::LibXML::Element) 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) $root->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); # add xsi namespace (simple)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment