convertxml.sh

 

#
###
### convertxml.sh
###
### Usage:  convertxml.sh 
###
### Recurse through directory tree, running
### convertb.sh against every xml file.
###
###

for i in `find . -name \*.xml -print`
do

    echo $i
    echo "<html>" > $i.html
    echo "<head><title>$file</title>" >> $i.html
    echo "<meta content=text/css http-equiv=Content-Style-Type>" >> $i.html
    echo "<link href=\"http://www.setgetweb.com/p/black.css\" rel=stylesheet type=text/css>" >> $i.html 
    echo "</head>" >> $i.html
    echo "<body>" >> $i.html

    echo "<font class=grey2>" >> $i.html
    echo "<blockquote>" >> $i.html
    echo "<blockquote>" >> $i.html
    echo "<p>&nbsp;</p>" >> $i.html
    echo "<center><h1>$file</h1></center>" >> $i.html
    echo "<p>&nbsp;</p>" >> $i.html
    echo "<p><hr>" >> $i.html
    echo "<pre>" >> $i.html

    cat $i | sed "s/^/ /g" |  sed "s/\&/\&amp/g" |  sed "s/</\&lt;/g" |  sed "s/>/\&gt;/g" >> $i.html

    echo "</pre>" >> $i.html
    echo "<center>  " >> $i.html
    echo "<p><hr>" >> $i.html
    echo "<p>&nbsp;</p>" >> $i.html
    echo "<p>&nbsp;</p>" >> $i.html

    echo "<script javascript=\"JavaScript\"> " >> $i.html
    echo "    document.write(\"<br>Last updated: \"+document.lastModified); " >> $i.html
    echo "</script> " >> $i.html

    echo "</blockquote>" >> $i.html
    echo "</blockquote>" >> $i.html
    echo "</body>" >> $i.html
    echo "</html>" >> $i.html
done