1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#!/bin/sh
# -*- tcl -*- \
exec tclsh "$0" "$@"
# simple.tcl --
#
# Simple transformation of a XML document,
# from README.
#
# Copyright (c) 2008-2009 Explain
# http://www.explain.com.au/
#
# $Id$
package require xml
set chan [open "count.xsl"]
set styleDoc [dom::parse [read $chan]]
close $chan
set sourceDoc [dom::parse [read stdin]]
set style [xslt::compile $styleDoc]
set resultDoc [$style transform $sourceDoc]
puts [dom::serialize $resultDoc]
exit 0
|