3 # Dumps the contents of the nominated Zebra database to a set of
4 # separate XML files with numeric names.
11 print STDERR "Usage: $0 target\n";
15 my $conn = new ZOOM::Connection($ARGV[0]);
16 $conn->option(preferredRecordSyntax => "xml");
17 $conn->option(elementSetName => "zebra::data");
18 my $rs = $conn->search_pqf('@attr 1=_ALLRECORDS @attr 2=103 ""');
21 print "$0: dumping $n records\n";
22 foreach my $i (1..$n) {
24 print " $i/$n (", int($i*100/$n), "%)\n" if $i % 50 == 0;
25 my $rec = $rs->record($i-1);
26 my $xml = $rec->render();
27 open F, ">$i.xml" or die "can't open\n";
31 print " $n/$n (100%)\n" if $n % 50 != 0;