Index: main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
===================================================================
--- main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm	(revision 32060)
+++ main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm	(revision 32061)
@@ -841,4 +841,17 @@
 }
 
+sub mxml_filename
+{
+    my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;
+
+    # Store the filename of the Current Fileset
+    # Note: According to http://greenstone.org/dtd/DirectoryMetadata/1.0/DirectoryMetadata.dtd
+    # FileName tag must come before Description tag
+    $parser->{'parameters'}->{'current_file'} = $attrHash->{'_content'};
+
+    # RAW is [$tagname => $attrHash] not $tagname => $attrHash!!
+    return [$tagname => $attrHash];
+}
+
 sub get_archives_metadata
 {
@@ -949,3 +962,45 @@
 }
 
+
+sub dxml_start_section
+{
+    my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;
+
+    my $new_depth = scalar(@$contextArray);
+
+#	print STDERR "**** START SECTION \n";
+	
+    if ($new_depth == 1) {
+	$parser->{'parameters'}->{'curr_section_depth'} = 1;
+	$parser->{'parameters'}->{'curr_section_num'}   = "";
+    }
+
+    my $old_depth  = $parser->{'parameters'}->{'curr_section_depth'};
+    my $old_secnum = $parser->{'parameters'}->{'curr_section_num'};
+
+    my $new_secnum;
+
+    if ($new_depth > $old_depth) {
+	# child subsection
+	$new_secnum = "$old_secnum.1";
+    }
+    elsif ($new_depth == $old_depth) {
+	# sibling section => increase it's value by 1
+	my ($tail_num) = ($old_secnum =~ m/\.(\d+)$/);
+	$tail_num++;
+	$new_secnum = $old_secnum;
+	$new_secnum =~ s/\.(\d+)$/\.$tail_num/;
+    }
+    else {
+	# back up to parent section => lopp off tail
+	$new_secnum = $old_secnum;
+	$new_secnum =~ s/\.\d+$//;
+    }
+
+    $parser->{'parameters'}->{'curr_section_depth'} = $new_depth;
+    $parser->{'parameters'}->{'curr_section_num'}   = $new_secnum;
+	
+	1;
+}
+
 1;
Index: main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm
===================================================================
--- main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm	(revision 32060)
+++ main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm	(revision 32061)
@@ -987,46 +987,4 @@
 }
 
-
-sub dxml_start_section
-{
-    my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;
-
-    my $new_depth = scalar(@$contextArray);
-
-#	print STDERR "**** START SECTION \n";
-	
-    if ($new_depth == 1) {
-	$parser->{'parameters'}->{'curr_section_depth'} = 1;
-	$parser->{'parameters'}->{'curr_section_num'}   = "";
-    }
-
-    my $old_depth  = $parser->{'parameters'}->{'curr_section_depth'};
-    my $old_secnum = $parser->{'parameters'}->{'curr_section_num'};
-
-    my $new_secnum;
-
-    if ($new_depth > $old_depth) {
-	# child subsection
-	$new_secnum = "$old_secnum.1";
-    }
-    elsif ($new_depth == $old_depth) {
-	# sibling section => increase it's value by 1
-	my ($tail_num) = ($old_secnum =~ m/\.(\d+)$/);
-	$tail_num++;
-	$new_secnum = $old_secnum;
-	$new_secnum =~ s/\.(\d+)$/\.$tail_num/;
-    }
-    else {
-	# back up to parent section => lopp off tail
-	$new_secnum = $old_secnum;
-	$new_secnum =~ s/\.\d+$//;
-    }
-
-    $parser->{'parameters'}->{'curr_section_depth'} = $new_depth;
-    $parser->{'parameters'}->{'curr_section_num'}   = $new_secnum;
-	
-	1;
-}
-
 sub edit_xml_file
 {
@@ -1651,18 +1609,4 @@
 
 
-sub mxml_filename
-{
-    my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;
-
-    # Store the filename of the Current Fileset
-    # Note: According to http://greenstone.org/dtd/DirectoryMetadata/1.0/DirectoryMetadata.dtd
-    # FileName tag must come before Description tag
-    $parser->{'parameters'}->{'current_file'} = $attrHash->{'_content'};
-
-    # RAW is [$tagname => $attrHash] not $tagname => $attrHash!!
-    return [$tagname => $attrHash];
-}
-
-
 sub mxml_fileset
 {
