lmandel | fe13d29 | 2005-07-11 19:53:21 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <xsl:stylesheet |
| 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 4 | version="1.0"> |
| 5 | |
| 6 | <xsl:output method="html" indent="yes"/> |
| 7 | |
| 8 | <xsl:variable name="root"> |
| 9 | <xsl:choose> |
| 10 | <xsl:when test="/html/head/meta[@name='root']/@content"> |
| 11 | <xsl:value-of select="/html/head/meta[@name='root']/@content" /> |
| 12 | </xsl:when> |
| 13 | <xsl:otherwise> |
| 14 | <xsl:text>../..</xsl:text> |
| 15 | </xsl:otherwise> |
| 16 | </xsl:choose> |
| 17 | </xsl:variable> |
| 18 | |
| 19 | <xsl:template match="/"> |
| 20 | <xsl:apply-templates /> |
| 21 | </xsl:template> |
| 22 | |
| 23 | <xsl:template match="html"> |
| 24 | <html> |
| 25 | <head> |
| 26 | <meta |
| 27 | content="text/html; charset=iso-8859-1" |
| 28 | http-equiv="Content-Type" /> |
| 29 | <link |
| 30 | type="text/css" |
| 31 | href="{$root}/apistyles.css" |
| 32 | rel="stylesheet" /> |
| 33 | <xsl:apply-templates select="head/title" /> |
| 34 | </head> |
| 35 | <body> |
| 36 | <xsl:apply-templates |
| 37 | select="body/*" |
| 38 | mode="body" /> |
| 39 | </body> |
| 40 | </html> |
| 41 | </xsl:template> |
| 42 | |
| 43 | <xsl:template |
| 44 | match="h1" |
| 45 | mode="banner"> |
| 46 | <table |
| 47 | border="0" |
| 48 | cellpadding="2" |
| 49 | cellspacing="5" |
| 50 | width="100%"> |
| 51 | <tbody> |
| 52 | <tr> |
| 53 | <td |
| 54 | align="left" |
| 55 | width="60%"> |
| 56 | <font class="indextop"> |
| 57 | <xsl:value-of select="." /> |
| 58 | </font> |
| 59 | <br /> |
| 60 | <font class="indexsub"> |
| 61 | <xsl:value-of select="/html/head/title" /> |
| 62 | </font> |
| 63 | </td> |
| 64 | <td width="40%"> |
| 65 | <img |
| 66 | src="{$root}/overview/Idea.jpg" |
| 67 | align="middle" |
| 68 | height="86" |
| 69 | hspace="50" |
| 70 | width="120" /> |
| 71 | </td> |
| 72 | </tr> |
| 73 | </tbody> |
| 74 | </table> |
| 75 | </xsl:template> |
| 76 | |
| 77 | <xsl:template |
| 78 | match="h1" |
| 79 | mode="body" /> |
| 80 | |
| 81 | <xsl:template |
| 82 | match="h2" |
| 83 | mode="body"> |
| 84 | |
| 85 | <table |
| 86 | border="0" |
| 87 | cellpadding="2" |
| 88 | cellspacing="5" |
| 89 | width="100%"> |
| 90 | <tbody> |
| 91 | <tr> |
| 92 | <td |
| 93 | colspan="2" |
| 94 | align="left" |
| 95 | bgcolor="#0080c0" |
| 96 | valign="top"> |
| 97 | <b> |
| 98 | <font |
| 99 | color="#ffffff" |
| 100 | face="Arial,Helvetica"> |
| 101 | <xsl:apply-templates /> |
| 102 | </font> |
| 103 | </b> |
| 104 | </td> |
| 105 | </tr> |
| 106 | </tbody> |
| 107 | </table> |
| 108 | </xsl:template> |
| 109 | |
| 110 | |
| 111 | <xsl:template |
| 112 | match="abstract" |
| 113 | mode="body"> |
| 114 | <p><xsl:apply-templates /></p> |
| 115 | </xsl:template> |
| 116 | |
| 117 | <xsl:template |
| 118 | match="codesnippet" |
| 119 | mode="body"> |
| 120 | <table |
| 121 | cellspacing="10" |
| 122 | cellpadding="10"> |
| 123 | <tr> |
| 124 | <td> |
| 125 | <p> |
| 126 | <xsl:element name="pre"> |
| 127 | <xsl:apply-templates /> |
| 128 | </xsl:element> |
| 129 | |
| 130 | </p> |
| 131 | </td> |
| 132 | </tr> |
| 133 | <tr> |
| 134 | <td> |
| 135 | <p> |
| 136 | <i>Snippet <xsl:value-of select="count(preceding-sibling::codesnippet)+1"/>: <xsl:value-of select="./@caption" /></i> |
| 137 | </p> |
| 138 | </td> |
| 139 | </tr> |
| 140 | </table> |
| 141 | </xsl:template> |
| 142 | |
| 143 | <xsl:template |
| 144 | match="p" |
| 145 | mode="body"> |
| 146 | <table width="500"> |
| 147 | <tr> |
| 148 | <td> |
| 149 | <p><xsl:apply-templates /></p> |
| 150 | </td> |
| 151 | </tr> |
| 152 | </table> |
| 153 | </xsl:template> |
| 154 | |
| 155 | <xsl:template |
| 156 | match="img" |
| 157 | mode="body"> |
| 158 | <table |
| 159 | cellspacing="10" |
| 160 | cellpadding="10"> |
| 161 | <tr> |
| 162 | <td> |
| 163 | <p> |
| 164 | <xsl:element name="img"> |
| 165 | <xsl:attribute name="src"><xsl:value-of select="./@src" /> </xsl:attribute> |
| 166 | </xsl:element> |
| 167 | |
| 168 | </p> |
| 169 | </td> |
| 170 | </tr> |
| 171 | <tr> |
| 172 | <td> |
| 173 | <p> |
| 174 | <i>Figure <xsl:value-of select="count(preceding-sibling::img)+1"/>: <xsl:value-of select="./@caption" /></i> |
| 175 | </p> |
| 176 | </td> |
| 177 | </tr> |
| 178 | </table> |
| 179 | </xsl:template> |
| 180 | |
| 181 | <xsl:template |
| 182 | match="h3" |
| 183 | mode="body"> |
| 184 | <img |
| 185 | src="{$root}/images/Adarrow.gif" |
| 186 | border="0" |
| 187 | height="16" |
| 188 | width="16" /> |
| 189 | <xsl:apply-templates /> |
| 190 | </xsl:template> |
| 191 | |
| 192 | <xsl:template |
| 193 | match="*" |
| 194 | mode="body"> |
| 195 | |
| 196 | <xsl:copy> |
| 197 | <xsl:apply-templates select="*|@*|text()" /> |
| 198 | </xsl:copy> |
| 199 | </xsl:template> |
| 200 | |
| 201 | <xsl:template match="*|@*|text()"> |
| 202 | <xsl:copy> |
| 203 | <xsl:apply-templates select="*|@*|text()" /> |
| 204 | </xsl:copy> |
| 205 | </xsl:template> |
| 206 | |
| 207 | </xsl:stylesheet> |