root/tags/lgt2211/xml/xhtml.sh

Revision 1513, 2.3 KB (checked in by pmoura, 4 years ago)

Updated release number to 2.21.1.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/sh
2
3## =================================================================
4## Logtalk - Object oriented extension to Prolog
5## Release 2.21.1
6##
7## Copyright (c) 1998-2004 Paulo Moura.  All Rights Reserved.
8## =================================================================
9
10XT_PATH="/Applications/XML/XT"
11# XT_PATH="/usr/local/XT"
12
13XSLT="lgtxhtml.xsl"
14
15if [ -z "$1" ]; then
16    title="Entity documentation index"
17else
18    title="$1"
19fi
20
21echo
22echo This script converts all .xml files in the current directory to .html
23echo files applying the XSLT transformation defined in the $XSLT file
24echo using the James Clark XT XSLT Java processor 20020426a or later version.
25echo
26echo An index.html file, containing links to all .html documenting files,
27echo is automatically generated. This file uses the script optional parameter
28echo value as the title of the index.html file.
29echo
30echo converting XML files to XHTML...
31
32for file in *.xml; do
33    echo "  converting" $file
34    name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
35    eval java -cp ${XT_PATH}/xt.jar:${XT_PATH}/lib/xp.jar -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver $file $XSLT $name.html
36done
37
38echo conversion done
39echo
40echo generating index file...
41
42echo "" > index.html
43
44echo "<?xml version=\"1.0\"?>" >> index.html
45echo "<?xml-stylesheet href=\"logtalk.css\" type=\"text/css\"?>" >> index.html
46echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" >> index.html
47echo "<html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">" >> index.html
48echo "<head>" >> index.html
49echo "    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>" >> index.html
50echo "    <title>"$title"</title>" >> index.html
51echo "    <link rel=\"stylesheet\" href=\"logtalk.css\" type=\"text/css\">" >> index.html
52echo "</head>" >> index.html
53echo "<body>" >> index.html
54echo "<h1>"$title"</h1>" >> index.html
55echo "<ul>" >> index.html
56
57for file in *.xml; do
58    name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
59    echo "  indexing" $name.html
60    echo "    <li><a href=\""$name.html"\">"$name"</a></li>" >> index.html
61done
62
63echo "</ul>" >> index.html
64
65date="`eval date`"
66
67echo "<p>Generated on "$date"</p>" >> index.html
68echo "</body>" >> index.html
69echo "</html>" >> index.html
70
71echo index file generated
72echo
Note: See TracBrowser for help on using the browser.