summaryrefslogtreecommitdiff
path: root/test/transform.pl
blob: 0c11d6195ef46c0a4022bcf64dacf4952c09fe2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl
# This file is part of libdom.
# It is used to generate libdom test files from the W3C DOMTS.
#
# Licensed under the MIT License,
#                http://www.opensource.org/licenses/mit-license.php
# Author: Bo Yang <struggleyb.nku@gmail.com>

use warnings;
use strict;

use lib qw(test);

use XML::Parser::PerlSAX;
use DOMTSHandler;

if ($#ARGV ne 2) {
	die "Usage: perl transform.pl dtd-file testcase basedir testcase-file";
}

my $handler = DOMTSHandler->new($ARGV[0], $ARGV[1]);
my $parser = XML::Parser::PerlSAX->new(Handler => $handler);
$parser->parse(Source => {SystemId => "$ARGV[2]"});