File: simple.tcl

package info (click to toggle)
tclxml 3.3~svn11-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,392 kB
  • sloc: ansic: 13,292; tcl: 11,656; xml: 3,269; sh: 559; makefile: 15
file content (27 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (2)
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