#!/usr/bin/perl -w # author: Xuejing Sun Dec. 2007 ## convert a list of terms into xml format readable by taxonomy_xml module $|=1; #Force buffer flush on STDOUT ($#ARGV == 1) || die "USAGE: perl taxonomy_list2xml.pl in_fn out_fn \n"; $in_fn=$ARGV[0]; $out_fn=$ARGV[1]; $VID=1; $VOCABULARY_NAME="Languages"; open (OUT,">$out_fn") or die; open (IN,"<$in_fn") || die "Can't open input file $!"; @term_list=; chomp(@term_list); close IN; print OUT "\n"; print OUT ""; print OUT "\n"; print OUT "$VID$VOCABULARY_NAME0000taxonomy0"; $TID=1; foreach (@term_list) { next if (/^$/); print OUT "$TID$VID$_000"; $TID++; } print OUT "\n"; close OUT;