- Timestamp:
- 2017-11-06T18:54:37+13:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm
r31617 r32061 987 987 } 988 988 989 990 sub dxml_start_section991 {992 my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;993 994 my $new_depth = scalar(@$contextArray);995 996 # print STDERR "**** START SECTION \n";997 998 if ($new_depth == 1) {999 $parser->{'parameters'}->{'curr_section_depth'} = 1;1000 $parser->{'parameters'}->{'curr_section_num'} = "";1001 }1002 1003 my $old_depth = $parser->{'parameters'}->{'curr_section_depth'};1004 my $old_secnum = $parser->{'parameters'}->{'curr_section_num'};1005 1006 my $new_secnum;1007 1008 if ($new_depth > $old_depth) {1009 # child subsection1010 $new_secnum = "$old_secnum.1";1011 }1012 elsif ($new_depth == $old_depth) {1013 # sibling section => increase it's value by 11014 my ($tail_num) = ($old_secnum =~ m/\.(\d+)$/);1015 $tail_num++;1016 $new_secnum = $old_secnum;1017 $new_secnum =~ s/\.(\d+)$/\.$tail_num/;1018 }1019 else {1020 # back up to parent section => lopp off tail1021 $new_secnum = $old_secnum;1022 $new_secnum =~ s/\.\d+$//;1023 }1024 1025 $parser->{'parameters'}->{'curr_section_depth'} = $new_depth;1026 $parser->{'parameters'}->{'curr_section_num'} = $new_secnum;1027 1028 1;1029 }1030 1031 989 sub edit_xml_file 1032 990 { … … 1651 1609 1652 1610 1653 sub mxml_filename1654 {1655 my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;1656 1657 # Store the filename of the Current Fileset1658 # Note: According to http://greenstone.org/dtd/DirectoryMetadata/1.0/DirectoryMetadata.dtd1659 # FileName tag must come before Description tag1660 $parser->{'parameters'}->{'current_file'} = $attrHash->{'_content'};1661 1662 # RAW is [$tagname => $attrHash] not $tagname => $attrHash!!1663 return [$tagname => $attrHash];1664 }1665 1666 1667 1611 sub mxml_fileset 1668 1612 {
Note:
See TracChangeset
for help on using the changeset viewer.