Changeset 10201
- Timestamp:
- 2005-07-01T15:17:47+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/bin/script/convert_coll_from_gs2.pl
r9899 r10201 208 208 209 209 $collwriter->startTag('format'); 210 write_format($collwriter, $format->{'SearchVList'} );210 write_format($collwriter, $format->{'SearchVList'}, "document"); 211 211 $collwriter->endTag('format'); 212 212 } … … 309 309 $dlist = "DateList"; 310 310 } 311 # need to work out how to split into classifier and document 311 312 if (defined $format->{$vlist} || defined $format->{"VList"}|| defined $format->{$hlist} || defined $format->{"HList"} || defined $format->{$dlist}) { 312 313 $collwriter->startTag('format'); 313 314 if (defined $format->{$vlist}) { 314 write_format($collwriter, $format->{$vlist} );315 write_format($collwriter, $format->{$vlist}, "document"); 315 316 } elsif (defined $format->{"VList"}) { 316 317 # use VList if no specific one 317 write_format($collwriter, $format->{"VList"} );318 write_format($collwriter, $format->{"VList"}, "document"); 318 319 } 319 320 if (defined $format->{$hlist}) { 320 write_format($collwriter, $format->{$hlist} );321 write_format($collwriter, $format->{$hlist}, "horizontal"); 321 322 } elsif (defined $format->{"HList"}) { 322 323 # use HList if no specific one 323 write_format($collwriter, $format->{"HList"} );324 write_format($collwriter, $format->{"HList"}, "horizontal"); 324 325 } 325 326 if (defined $format->{$dlist}) { 326 write_format($collwriter, $format->{$dlist} );327 write_format($collwriter, $format->{$dlist}, "document"); 327 328 } 328 329 $collwriter->endTag('format'); … … 444 445 445 446 sub write_format { 446 my ($writer, $old_format ) = @_;447 my ($writer, $old_format, $node_type) = @_; 447 448 # replace \' with ' 448 449 $old_format =~ s/\\\'/\'/g; … … 481 482 $old_format =~ s/=([a-z]+)([> ])/=\'$1\'$2/g; 482 483 483 $writer->startTag('gsf:template', 'match'=>'documentNode'); 484 $writer->charactersXML($old_format); 485 $writer->endTag('gsf:template'); 486 487 484 if ($node_type eq "document") { 485 $writer->startTag('gsf:template', 'match'=>'documentNode'); 486 $writer->charactersXML($old_format); 487 $writer->endTag('gsf:template'); 488 } elsif ($node_type eq "classifier") { 489 $writer->startTag('gsf:template', 'match'=>'classifierNode'); 490 $writer->charactersXML($old_format); 491 $writer->endTag('gsf:template'); 492 } elsif ($node_type eq "horizontal") { 493 $writer->startTag('gsf:template', 'match'=>'classifierNode', 'mode'=>'horizontal'); 494 $writer->charactersXML($old_format); 495 $writer->endTag('gsf:template'); 496 497 } 488 498 } 489 499
Note:
See TracChangeset
for help on using the changeset viewer.