[open-ils-commits] r424 - conifer/trunk/tools/migration-scripts (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 30 11:23:40 EDT 2009
Author: dbs
Date: 2009-04-30 11:23:38 -0400 (Thu, 30 Apr 2009)
New Revision: 424
Modified:
conifer/trunk/tools/migration-scripts/fix_bad_marcxml.pl
Log:
Depending on when you process the XML, the annoying characters may be escaped
Modified: conifer/trunk/tools/migration-scripts/fix_bad_marcxml.pl
===================================================================
--- conifer/trunk/tools/migration-scripts/fix_bad_marcxml.pl 2009-04-30 12:01:03 UTC (rev 423)
+++ conifer/trunk/tools/migration-scripts/fix_bad_marcxml.pl 2009-04-30 15:23:38 UTC (rev 424)
@@ -33,15 +33,18 @@
# </datafield>
#
# This will at least enable MARC::File::XML to process it:
- if ($_ =~ m#<subfield code=""">#o) {
+ if ($_ =~ m#<subfield code=""">#o or $_ =~ m#<subfield code=""">#o ) {
print STDERR "Bad subfield code \" at line $lineno of file $file\n";
$_ =~ s{<subfield code=""">}{<subfield code="Z">}o;
- } elsif ($_ =~ m#<subfield code="<">#o) {
+ $_ =~ s{<subfield code=""">}{<subfield code="Z">}o;
+ } elsif ($_ =~ m#<subfield code="<">#o or $_ =~ m#<subfield code="<">#o) {
print STDERR "Bad subfield code < at line $lineno of file $file\n";
$_ =~ s{<subfield code="<">}{<subfield code="Z">}o;
- } elsif ($_ =~ m#<subfield code="&">#o) {
+ $_ =~ s{<subfield code="<">}{<subfield code="Z">}o;
+ } elsif ($_ =~ m#<subfield code="&">#o or $_ =~ m#<subfield code="&">#o) {
print STDERR "Bad subfield code & at line $lineno of file $file\n";
$_ =~ s{<subfield code="&">}{<subfield code="Z">}o;
+ $_ =~ s{<subfield code="&">}{<subfield code="Z">}o;
} elsif ($_ =~ m#<datafield tag="(\d)" ind1="."#o) {
my $badtag = $1;
print STDERR "Bad datafield tag $badtag at line $lineno of file $file\n";
More information about the open-ils-commits
mailing list