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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
<?xml version='1.0' encoding="ISO-8859-1" ?>
<!-- the following seems not to work with libxml -->
<!DOCTYPE stylesheet [
<!ENTITY nbsp "<xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text>">
<!ENTITY space "<xsl:text> </xsl:text>">
<!ENTITY cr "<xsl:text>
</xsl:text>">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:variable name="newswidth">152</xsl:variable>
<xsl:param name="page" select="0"/>
<xsl:param name="basename">default</xsl:param>
<xsl:param name="extension">html???</xsl:param>
<xsl:param name="baseuri">/eg/web/</xsl:param>
<xsl:param name="imageuri">/eg/images/</xsl:param>
<!-- - - - - list - - - - -->
<xsl:template match="list">
<table border="0" cellspacing="3" cellpadding="0">
<xsl:apply-templates mode="item"/>
</table>
</xsl:template>
<xsl:template match="item" mode="item">
<tr class="cItemText">
<td valign="top">
<img src="{$imageuri}but.gif"/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
<td>
<xsl:apply-templates select="itemtext"/>
</td>
</tr>
<xsl:if test="*[name()!='itemtext']">
<tr>
<td>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
<td>
<xsl:apply-templates select="*[name()!='itemtext']"/>
</td>
</tr>
<tr>
<td colspan="2">
<img src="{$imageuri}transp.gif" height="4"/>
</td>
</tr>
</xsl:if>
</xsl:template>
<xsl:template match="list" mode="item">
<tr>
<td>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
<td>
<table border="0" cellspacing="3" cellpadding="0">
<xsl:apply-templates mode="item"/>
</table>
</td>
</tr>
</xsl:template>
<xsl:template match="itemtext">
<p><xsl:apply-templates/></p>
</xsl:template>
<!-- - - - - code - - - - -->
<!--
<xsl:template match="verbatim">
<xsl:if test="not(preceding-sibling::node()[1][name()='verbatim'])">
<table width="100%" cellspacing="0"><tr>
<td width="5%"><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td class="cPodVerbatim" width="90%">
<br/><pre>
<xsl:apply-templates/>
<xsl:apply-templates select="following-sibling::node()[1][name()='verbatim']" mode="verbatim"/>
</pre>
</td>
<td width="5%"><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
</tr></table>
</xsl:if>
</xsl:template>
-->
<xsl:template match="verbatim">
<xsl:if test="not(preceding-sibling::node()[1][name()='verbatim'])">
<pre class="cPodVerbatim">
<xsl:apply-templates/>
<xsl:apply-templates select="following-sibling::node()[1][name()='verbatim']" mode="verbatim"/>
</pre>
</xsl:if>
</xsl:template>
<xsl:template match="verbatim" mode="verbatim">
<xsl:text>
</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates select="following-sibling::node()[1][name()='verbatim']" mode="verbatim"/>
</xsl:template>
<!-- - - - - link - - - - -->
<xsl:template name="link">
<xsl:param name="txt"/>
<xsl:param name="uri"/>
<xsl:param name="useuri"/>
<xsl:choose>
<xsl:when test="contains($uri, '.pod')">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$baseuri"/>pod/doc/<xsl:value-of select="substring-before($uri, '.pod')"/>.htm</xsl:attribute>
<xsl:value-of select="$txt"/>
</xsl:element>
</xsl:when>
<xsl:when test="contains($uri, '::')">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="translate($uri, ':', '/')"/></xsl:attribute>
<xsl:value-of select="$txt"/>
</xsl:element>
</xsl:when>
<xsl:when test="starts-with($uri, 'http:')">
<a href="{$uri}"><xsl:value-of select="$txt"/></a>
</xsl:when>
<xsl:when test="starts-with($uri, 'ftp:')">
<a href="{$uri}"><xsl:value-of select="$txt"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="page">
<xsl:apply-templates select="//sect1[title=$uri]" mode="number"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$page!=''">
<a href="{$basename}.-page-{$page}-.{$extension}"><xsl:value-of select="$txt"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="page2">
<xsl:apply-templates select="//sect1[sect2/title=$uri]" mode="number"/>
</xsl:variable>
<xsl:variable name="sect2">
<xsl:apply-templates select="//sect2[title=$uri]" mode="number"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$page2!=''">
<a href="{$basename}.-page-{$page2}-.{$extension}#sect_{$sect2}"><xsl:value-of select="$txt"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$useuri">
<a href="{$useuri}"><xsl:value-of select="$txt"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$txt"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="xlink">
<xsl:choose>
<xsl:when test="@uri">
<xsl:call-template name="link">
<xsl:with-param name="uri" select="@uri"/>
<xsl:with-param name="useuri" select="@uri"/>
<xsl:with-param name="txt" select="."/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="link">
<xsl:with-param name="uri" select="."/>
<xsl:with-param name="txt" select="."/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="para">
<p class="body"><xsl:apply-templates/></p>
</xsl:template>
<!-- - - - - text - - - - -->
<xsl:template match="emphasis">
<i><xsl:value-of select="."/></i>
</xsl:template>
<xsl:template match="strong">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="code">
<code><xsl:value-of select="."/></code>
</xsl:template>
<xsl:template match="underline">
<u><xsl:value-of select="."/></u>
</xsl:template>
<xsl:template match="pic">
<p class="cPic">
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
</xsl:element>
</p>
</xsl:template>
</xsl:stylesheet>
|