From: Shawn Boyette Date: Mon, 27 Apr 2009 02:59:23 +0000 (+0000) Subject: multiples of non-multi fields is now fatal X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=ca9dd06ee372e59b4fe0ecdcbe24cf7468d8577f multiples of non-multi fields is now fatal --- diff --git a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm index 9297105..9844daf 100644 --- a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm +++ b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm @@ -6,6 +6,16 @@ use strict; use XML::Twig; use Equinox::Migration::SubfieldMapper 1.002; +# FIXME +# +# sample functionality should be extracted into a new module which +# uses E::M::SM to drive sampling of individual datafields, and +# reports ALL datafields which occur +# +# --sample should give the list of all datafields +# --samplefile should take a SM map as teh argument and introspect the mapped datafields + + =head1 NAME Equinox::Migration::MapDrivenMARCXMLProc @@ -190,10 +200,34 @@ sub process_subs { push @{$dataf->{multi}{$name}}, $sub->text; } } else { + die "Multiple occurances of a non-multi field: \n" + if (defined $dataf->{uni}{$code}); $dataf->{uni}{$code} = $sub->text; } } +=head1 MODIFIERS + +MapDrivenMARCXMLProc implements the following modifiers, and passes +them to L, meaning that specifying +any other modifiers in a MDMP map file will cause a fatal error when +it is processed. + +=head2 multi + +If a mapping is declared to be C, then MDMP expects to see more +than one instance of that subfield per datafield, and the data is +handled accordingly (see L below). + +Occurring zero or one time is legal for a C mapping. + +A mapping which is not flagged as C, but which occurs more than +once per datafield will cause a fatal error. + +=head2 bib + +=head2 required + =head1 PARSED RECORDS Given: