Repeated tags working now. Indicators next

This commit is contained in:
kados 2006-03-01 05:20:17 +00:00
parent dbbd897481
commit 0da9ce83ee
1 changed files with 11 additions and 2 deletions

View File

@ -1043,6 +1043,8 @@ sub MARChtml2xml {
my $prevtag=-1;
my $first=1;
for (my $i=0;$i<=@$tags;$i++){
if ((@$tags[$i] ne $prevtag)){
if (!$first){
$xml.="</datafield>\n";
@ -1055,7 +1057,7 @@ sub MARChtml2xml {
$xml.="<leader>@$values[$i]</leader>\n";
$first=1;
# rest of the fixed fields
} elsif (@$tags[$i] lt "010") {
} elsif (@$tags[$i] < 10) {
warn "IN THE IF";
$xml.="<controlfield tag=\"@$tags[$i]\">@$values[$i]</controlfield>\n";
$first=1;
@ -1071,7 +1073,10 @@ sub MARChtml2xml {
if (@$values[$i] eq "") {
}
else {
if ($first){
$xml.="<datafield tag=\"@$tags[$i]\" ind1=\" \" ind2=\" \">\n";
$first=0;
}
$xml.="<subfield code=\"@$subfields[$i]\">@$values[$i]</subfield>\n";
}
@ -1079,6 +1084,7 @@ sub MARChtml2xml {
$prevtag = @$tags[$i];
}
$xml.= MARC::File::XML::footer();
warn $xml;
return $xml
}
sub MARChtml2marc {
@ -2979,6 +2985,9 @@ Paul POULAIN paul.poulain@free.fr
# $Id$
# $Log$
# Revision 1.115.2.40 2006/03/01 05:20:17 kados
# Repeated tags working now. Indicators next
#
# Revision 1.115.2.39 2006/03/01 04:52:08 rangi
# More testing
#