1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
5 <!-- <xsl:output method="text" doctype-public="-//W3C//DTD HTML 3.2//EN" omit-xml-declaration="yes"/> -->
7 <!-- inputvariable declaration -->
8 <xsl:param name=
"os1"/>
9 <xsl:param name=
"cp1"/>
10 <xsl:param name=
"com1"/>
11 <xsl:param name=
"lang1"/>
12 <xsl:param name=
"type"/>
13 <xsl:param name=
"file"/>
14 <xsl:strip-space elements=
"*"/>
16 <xsl:param name=
"platform">
17 <xsl:if test=
"$os1='LINUX'">
18 <xsl:value-of select=
"'LINUX'"/>
20 <xsl:if test=
"$os1='WNT'">
21 <xsl:value-of select=
"'WIN'"/>
23 <xsl:if test=
"$os1='SOLARIS'">
24 <xsl:if test=
"$cp1='SPARC'">
25 <xsl:value-of select=
"'SOLSPARC'"/>
27 <xsl:if test=
"$cp1='INTEL'">
28 <xsl:value-of select=
"'SOLX86'"/>
31 <xsl:if test=
"$os1='MACOSX'">
32 <xsl:value-of select=
"'MAC'"/>
38 <xsl:when test=
"$platform='WIN'"><xsl:text>
</xsl:text></xsl:when>
39 <xsl:otherwise><xsl:text>
</xsl:text></xsl:otherwise>
43 <xsl:template match=
"/">
45 <xsl:when test=
"$type='html'">
47 <xsl:document method=
"html" href=
"{$file}" doctype-public=
"-//W3C//DTD HTML 3.2//EN">
48 <xsl:apply-templates mode=
"html"/>
52 <xsl:when test=
"$type='text'">
54 <xsl:document method=
"text" href=
"{$file}">
55 <xsl:call-template name=
"textout" />
62 <xsl:template match=
"*" mode=
"html">
64 <xsl:when test=
"(contains(@class,$platform) or not(@class) or (name(.)='p'))">
65 <xsl:if test=
"(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
66 <xsl:element name=
"{name(.)}">
67 <xsl:if test=
"(name(.)='a')">
68 <xsl:attribute name=
"href">
69 <xsl:value-of select=
"@href"/>
72 <xsl:if test=
"(name(.)='p') and (@class)">
73 <xsl:attribute name=
"class">
74 <xsl:value-of select=
"@class"/>
77 <xsl:if test=
"name(.)='div'">
78 <xsl:attribute name=
"id">
79 <xsl:value-of select=
"@id"/>
82 <xsl:apply-templates mode=
"html"/>
92 <xsl:template name=
"textout">
93 <xsl:apply-templates />
96 <xsl:template match=
"*">
97 <xsl:if test=
"(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
99 <xsl:when test=
"name(.)='html'">
100 <xsl:apply-templates/>
102 <xsl:when test=
"name(.)='body'">
103 <xsl:apply-templates/>
105 <xsl:when test=
"name(.)='hr'">
108 ----------------------------------------------------------------------------------------------------------
112 <xsl:when test=
"name(.)='div'">
113 <xsl:if test=
"(contains(@class,$platform) or not(@class))">
114 <xsl:apply-templates/>
117 <xsl:when test=
"name(.)='a'">
118 <xsl:apply-templates/>
120 <xsl:when test=
"name(.)='tt'">
121 <xsl:apply-templates/>
123 <xsl:when test=
"name(.)='li'">
124 <xsl:value-of select=
"$lf"/>*
<xsl:apply-templates/>
126 <xsl:when test=
"name(.)='ul'">
127 <xsl:value-of select=
"$lf"/>
128 <xsl:apply-templates/>
130 <xsl:when test=
"name(.)='ol'">
131 <xsl:value-of select=
"$lf"/>
132 <xsl:apply-templates/>
134 <xsl:when test=
"name(.)='p'">
135 <xsl:if test=
"(not(name(..)='li') and (count(a) = 0))">
136 <xsl:value-of select=
"$lf"/>
137 <xsl:value-of select=
"$lf"/>
139 <xsl:apply-templates/>
141 <xsl:when test=
"name(.)='h1'">
142 <xsl:value-of select=
"$lf"/>
143 <xsl:text>======================================================================
</xsl:text>
144 <xsl:value-of select=
"$lf"/>
145 <xsl:apply-templates/>
146 <xsl:value-of select=
"$lf"/>
147 <xsl:text>======================================================================
</xsl:text>
148 <xsl:value-of select=
"$lf"/>
150 <xsl:when test=
"name(.)='h2'">
151 <xsl:value-of select=
"$lf"/>
152 <xsl:value-of select=
"$lf"/>
153 <xsl:text>----------------------------------------------------------------------
</xsl:text>
154 <xsl:value-of select=
"$lf"/>
155 <xsl:apply-templates/>
156 <xsl:value-of select=
"$lf"/>
157 <xsl:text>----------------------------------------------------------------------
</xsl:text>
159 <xsl:when test=
"name(.)='h3'">
160 <xsl:value-of select=
"$lf"/>
161 <xsl:value-of select=
"$lf"/>
162 <xsl:apply-templates/>
163 <xsl:value-of select=
"$lf"/>
164 <xsl:text>----------------------------------------------------------------------
</xsl:text>