Applied Mike's nice -d option thing.
[irspy-moved-to-github.git] / bin / xslt_process.pl
1 #!/usr/bin/perl -w
2
3 # $Id: xslt_process.pl,v 1.3 2007-02-02 11:30:50 mike Exp $
4
5 use strict;
6 use warnings;
7 use lib '../lib';
8 use Getopt::Std;
9 use ZOOM::IRSpy;
10 use XML::LibXSLT;
11
12 if (@ARGV && $ARGV[0] eq "-d") {
13     shift;
14     XML::LibXSLT->debug_callback(\&xslt_debug);
15 }
16
17 my $dbname = 'localhost:8018/IR-Explain---1';
18 my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat");
19 my $source_file = shift || die("$0: Please specify xml instance file");
20 my $source_doc = $spy->{libxml}->parse_file($source_file);
21 my $results = $spy->{irspy_to_zeerex_style}->transform($source_doc);
22
23 print $results->toString(), "\n\n";
24
25
26
27 sub xslt_debug {
28     my ($msg) = @_;
29
30     print STDERR $msg;
31 }