summaryrefslogtreecommitdiff
path: root/test/transform.pl
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform.pl')
-rwxr-xr-xtest/transform.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/transform.pl b/test/transform.pl
new file mode 100755
index 0000000..4ab0b46
--- /dev/null
+++ b/test/transform.pl
@@ -0,0 +1,21 @@
+#!/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 XML::Parser::PerlSAX;
+use DOMTSHandler;
+
+if ($#ARGV ne 1) {
+ die "Usage: perl transform.pl dtd-file testcase-file";
+}
+
+my $handler = DOMTSHandler->new($ARGV[0]);
+my $parser = XML::Parser::PerlSAX->new(Handler => $handler);
+$parser->parse(Source => {SystemId => "$ARGV[1]"});