3 # $Id: zoomdump,v 1.2 2007-03-07 11:34:26 mike Exp $
5 # Dumps the contents of the nominated Zebra database to a set of
6 # separate XML files with numeric names.
13 print STDERR "Usage: $0 target\n";
17 my $conn = new ZOOM::Connection($ARGV[0]);
18 $conn->option(preferredRecordSyntax => "xml");
19 $conn->option(elementSetName => "zebra::data");
20 my $rs = $conn->search_pqf('@attr 1=_ALLRECORDS @attr 2=103 ""');
23 print "$0: dumping $n records\n";
24 foreach my $i (1..$n) {
26 print " $i/$n (", int($i*100/$n), "%)\n" if $i % 50 == 0;
27 my $rec = $rs->record($i-1);
28 my $xml = $rec->render();
29 open F, ">$i.xml" or die "can't open\n";
33 print " $n/$n (100%)\n" if $n % 50 != 0;