#!/bin/ksh -f # Builds composite XHTML Strict DTD from modules. # The result is a flattened DTD 'xhtml-s-flat.dtd'. # Requires spam, sed, and a valid, minimal xml file 'test-s.xml' # # Author: Murray Altheim # origin $Id: @(#)_flat 1.2 - 97/05/01 19:59:33 altheim $ # set source dtd filename if [ $# -ne 0 ]; then echo "Usage: % _flat-s" exit 0 fi # set flattened dtd filename flat="XHTML1-s-flat.dtd" echo "_flat-s: Removing old files..." #rm sperr [ -f $flat ] && rm $flat #spam a new dtd: echo "_flat-s: Creating new '$flat'..." spam -p -p test-s.xml > /tmp/flat.temp # remove document wrapper: sed 's/<\!DOCTYPE [Hh][Tt][Mm][Ll] \[//' /tmp/flat.temp > /tmp/flat.temp2 sed '/^]>$/,$d' /tmp/flat.temp2 > $flat rm /tmp/flat.temp rm /tmp/flat.temp2 echo "_flat-s: complete."