From 2663e385ad3d1bba9ecd0ff191ce92b11dce8a1b Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Mon, 27 Apr 2009 03:29:38 +0000 Subject: [PATCH 1/1] multi on non-multi mapping error implemented --- .../lib/Equinox/Migration/MapDrivenMARCXMLProc.pm | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm index 9844daf..2854546 100644 --- a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm +++ b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm @@ -133,6 +133,8 @@ sub parse_record { $record->purge; $self->{data}{rptr}++; + # FIXME check for required fields here + return $self->{data}{crec}; } @@ -200,7 +202,7 @@ sub process_subs { push @{$dataf->{multi}{$name}}, $sub->text; } } else { - die "Multiple occurances of a non-multi field: \n" + die "Multiple occurances of a non-multi field: $tag$code at rec ",($self->{data}{rptr} + 1),"\n" if (defined $dataf->{uni}{$code}); $dataf->{uni}{$code} = $sub->text; } @@ -226,8 +228,18 @@ once per datafield will cause a fatal error. =head2 bib +The C modifier declares that a mapping is "bib-level", and should +be encountered once per B instead of once per B -- +which is another way of saying that it occurs in a non-repeating +datafield or in a controlfield. + =head2 required +By default, if a mapping does not occur in a datafield (or record, in +the case of C mappings), processing continues normally. if a +mapping has the C modifier, however, it must appear, or a +fatal error will occur. + =head1 PARSED RECORDS Given: -- 1.7.2.5