| 1 | <?xml version="1.0"?>
|
|---|
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="2.0">
|
|---|
| 3 | <xsl:output method="xhtml" indent="yes" name="html" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
|
|---|
| 4 |
|
|---|
| 5 | <xsl:param name="folder"/>
|
|---|
| 6 | <xsl:param name="includeconstructbodies"/>
|
|---|
| 7 | <xsl:param name="hideconstructbodies"/>
|
|---|
| 8 | <xsl:param name="showOriginalT3DocTags"/>
|
|---|
| 9 | <!-- //TODO: add further parameters such as file names for scripts and such -->
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | <xsl:template match="/">
|
|---|
| 15 | <xsl:for-each select="//module">
|
|---|
| 16 | <xsl:variable name="filename" select="concat('file:///', $folder, '/html/import_', @name, '.html')"/>
|
|---|
| 17 | <xsl:value-of select="$filename"/>
|
|---|
| 18 | <xsl:result-document href="{$filename}" format="html">
|
|---|
| 19 | <xsl:call-template name="import_module">
|
|---|
| 20 | <xsl:with-param name="module" select="."/>
|
|---|
| 21 | </xsl:call-template>
|
|---|
| 22 | </xsl:result-document>
|
|---|
| 23 | </xsl:for-each>
|
|---|
| 24 | </xsl:template>
|
|---|
| 25 |
|
|---|
| 26 | <xsl:template name="import_module">
|
|---|
| 27 | <xsl:param name="module"/>
|
|---|
| 28 | <xsl:param name="modulename" select="$module/@name"/>
|
|---|
| 29 |
|
|---|
| 30 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|---|
| 31 | <xsl:call-template name="html_head">
|
|---|
| 32 | <xsl:with-param name="title" select="concat($modulename, ' - Import View')"/>
|
|---|
| 33 | </xsl:call-template>
|
|---|
| 34 | <body>
|
|---|
| 35 | <div id="div_views">
|
|---|
| 36 | <p id="p_views">
|
|---|
| 37 | <a href="{concat($module/@name, '.html')}">Main View</a> <br/>
|
|---|
| 38 | <a href="{concat('mp_', $module/@name, '.html')}">Module Parameter/Testcase View</a> <br/>
|
|---|
| 39 | <a href="{concat('import_', $module/@name, '.html')}">Import View</a> <br/>
|
|---|
| 40 | <br/>
|
|---|
| 41 | <a href="#" onclick="toggleImportDetails()">toggle import details</a>
|
|---|
| 42 | </p>
|
|---|
| 43 | </div>
|
|---|
| 44 | <p id="p_t3dversion">T3D <xsl:value-of select="/imports/@t3dversion"/><br/>Generated <xsl:value-of select="concat(substring-before(string(current-date()), '+'), ' - ', substring-before(string(current-time()), '.'))"/></p>
|
|---|
| 45 | <div id="div_modules">
|
|---|
| 46 | <p class="index_headline"><a href="import_index.html">Module Index</a>
|
|---|
| 47 | <xsl:for-each select="//module">
|
|---|
| 48 | <xsl:sort select="@name"/>
|
|---|
| 49 | <br/><a class="padding_left_10px" href="{concat('import_', @name)}.html"><xsl:value-of select="@name"/></a>
|
|---|
| 50 | </xsl:for-each>
|
|---|
| 51 | </p>
|
|---|
| 52 | </div>
|
|---|
| 53 | <xsl:call-template name="legend"/>
|
|---|
| 54 | <p id="p_header"><a href="import_index.html">Index</a><xsl:value-of select="' / '"/><xsl:value-of select="$modulename"/> - Import View</p>
|
|---|
| 55 | <div id="div_content">
|
|---|
| 56 | <div id="div_import">
|
|---|
| 57 | <table id="table_import">
|
|---|
| 58 | <tr>
|
|---|
| 59 | <th><span class="imports">imports</span></th><th>Modules</th><th><span class="importedby">imported by</span></th>
|
|---|
| 60 | </tr>
|
|---|
| 61 | <tr>
|
|---|
| 62 | <td>
|
|---|
| 63 | <xsl:for-each select="$module/import[not(@name = preceding-sibling::import/@name)]/@name">
|
|---|
| 64 | <xsl:sort select="."/>
|
|---|
| 65 | <xsl:call-template name="import">
|
|---|
| 66 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 67 | <xsl:with-param name="importname" select="."/>
|
|---|
| 68 | </xsl:call-template>
|
|---|
| 69 | </xsl:for-each>
|
|---|
| 70 | <xsl:variable name="indirectimports" select="$module/import//import[not(@name = $module/import/@name) and not(@name = $module/@name)]"/>
|
|---|
| 71 | <xsl:if test="$indirectimports">
|
|---|
| 72 | <br/>Indirect dependencies:
|
|---|
| 73 | </xsl:if>
|
|---|
| 74 | <xsl:for-each select="$indirectimports[not(@name = preceding-sibling::*/@name)]/@name">
|
|---|
| 75 | <xsl:sort select="."/>
|
|---|
| 76 | <xsl:variable name="name" select="."/>
|
|---|
| 77 | <br/>
|
|---|
| 78 | <xsl:choose>
|
|---|
| 79 | <xsl:when test="//module[@name eq $name]">
|
|---|
| 80 | <a class="padding_left_10px" href="{concat('import_', $name, '.html')}"><xsl:value-of select="$name"/></a>
|
|---|
| 81 | </xsl:when>
|
|---|
| 82 | <xsl:otherwise>
|
|---|
| 83 | <span class="padding_left_10px"><xsl:value-of select="$name"/></span>
|
|---|
| 84 | </xsl:otherwise>
|
|---|
| 85 | </xsl:choose>
|
|---|
| 86 | </xsl:for-each>
|
|---|
| 87 | </td>
|
|---|
| 88 | <td id="table_import_modules">
|
|---|
| 89 | <xsl:for-each select="//module">
|
|---|
| 90 | <xsl:sort select="@name"/>
|
|---|
| 91 | <p>
|
|---|
| 92 | <xsl:call-template name="show_imports">
|
|---|
| 93 | <xsl:with-param name="currentmodule" select="$module"/>
|
|---|
| 94 | <xsl:with-param name="module" select="."/>
|
|---|
| 95 | </xsl:call-template>
|
|---|
| 96 | </p>
|
|---|
| 97 | </xsl:for-each>
|
|---|
| 98 | </td>
|
|---|
| 99 | <td>
|
|---|
| 100 | <xsl:for-each select="//module">
|
|---|
| 101 | <xsl:sort select="@name"/>
|
|---|
| 102 | <xsl:if test="import[@name eq $module/@name]">
|
|---|
| 103 | <a href="{concat('import_', @name, '.html')}"><xsl:value-of select="@name"/></a>
|
|---|
| 104 | <xsl:call-template name="importby">
|
|---|
| 105 | <xsl:with-param name="imports" select="./import[@name eq $module/@name]"/>
|
|---|
| 106 | </xsl:call-template>
|
|---|
| 107 | </xsl:if>
|
|---|
| 108 | </xsl:for-each>
|
|---|
| 109 | <xsl:variable name="indirectdependencies" select="//module[import//import[@name = $module/@name and not(@name = ancestor::module/import/@name)] and not(@name = $module/@name)]"/>
|
|---|
| 110 | <xsl:if test="$indirectdependencies">
|
|---|
| 111 | <br/>Indirect dependencies:
|
|---|
| 112 | </xsl:if>
|
|---|
| 113 | <xsl:for-each select="$indirectdependencies[not(@name = preceding-sibling::*/@name)]/@name">
|
|---|
| 114 | <xsl:sort select="."/>
|
|---|
| 115 | <xsl:variable name="name" select="."/>
|
|---|
| 116 | <br/>
|
|---|
| 117 | <xsl:choose>
|
|---|
| 118 | <xsl:when test="//module[@name eq $name]">
|
|---|
| 119 | <a class="padding_left_10px" href="{concat('import_', $name, '.html')}"><xsl:value-of select="$name"/></a>
|
|---|
| 120 | </xsl:when>
|
|---|
| 121 | <xsl:otherwise>
|
|---|
| 122 | <span class="padding_left_10px"><xsl:value-of select="$name"/></span>
|
|---|
| 123 | </xsl:otherwise>
|
|---|
| 124 | </xsl:choose>
|
|---|
| 125 | </xsl:for-each>
|
|---|
| 126 | </td>
|
|---|
| 127 | </tr>
|
|---|
| 128 | </table>
|
|---|
| 129 | </div>
|
|---|
| 130 | </div>
|
|---|
| 131 | </body>
|
|---|
| 132 | </html>
|
|---|
| 133 | </xsl:template>
|
|---|
| 134 |
|
|---|
| 135 | <xsl:template name="import">
|
|---|
| 136 | <xsl:param name="module"/>
|
|---|
| 137 | <xsl:param name="importname"/>
|
|---|
| 138 | <xsl:if test="$module/import[@name eq $importname]">
|
|---|
| 139 | <xsl:choose>
|
|---|
| 140 | <xsl:when test="//module[@name = $importname]">
|
|---|
| 141 | <a href="{concat('import_', ., '.html')}"><xsl:value-of select="concat(., @name)"/></a>
|
|---|
| 142 | </xsl:when>
|
|---|
| 143 | <xsl:otherwise>
|
|---|
| 144 | <xsl:value-of select="concat(., @name)"/>
|
|---|
| 145 | </xsl:otherwise>
|
|---|
| 146 | </xsl:choose>
|
|---|
| 147 | <table class="padding_left_10px">
|
|---|
| 148 | <xsl:for-each select="$module/import[@name eq $importname]">
|
|---|
| 149 | <tr>
|
|---|
| 150 | <td>
|
|---|
| 151 | <span class="span_importdetail">
|
|---|
| 152 | <xsl:apply-templates select="import_behaviour"/><br/>
|
|---|
| 153 | </span>
|
|---|
| 154 | </td>
|
|---|
| 155 | </tr>
|
|---|
| 156 | </xsl:for-each>
|
|---|
| 157 | </table>
|
|---|
| 158 | </xsl:if>
|
|---|
| 159 | </xsl:template>
|
|---|
| 160 |
|
|---|
| 161 | <xsl:template name="importby">
|
|---|
| 162 | <xsl:param name="imports"/>
|
|---|
| 163 | <xsl:if test="$imports">
|
|---|
| 164 | <table class="padding_left_10px">
|
|---|
| 165 | <xsl:for-each select="$imports">
|
|---|
| 166 | <tr>
|
|---|
| 167 | <td><span class="span_importdetail"><xsl:apply-templates select="import_behaviour"/></span></td>
|
|---|
| 168 | </tr>
|
|---|
| 169 | </xsl:for-each>
|
|---|
| 170 | </table>
|
|---|
| 171 | </xsl:if>
|
|---|
| 172 | </xsl:template>
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 | <xsl:template name="show_imports">
|
|---|
| 176 | <xsl:param name="module"/>
|
|---|
| 177 | <xsl:param name="currentmodule"/>
|
|---|
| 178 | <xsl:choose>
|
|---|
| 179 | <xsl:when test="$currentmodule/@name eq $module/@name">
|
|---|
| 180 | <xsl:call-template name="colored_module">
|
|---|
| 181 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 182 | <xsl:with-param name="color" select="'selected'"/>
|
|---|
| 183 | </xsl:call-template>
|
|---|
| 184 | </xsl:when>
|
|---|
| 185 | <xsl:when test="$currentmodule/import[@name eq $module/@name]">
|
|---|
| 186 | <xsl:call-template name="colored_module">
|
|---|
| 187 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 188 | <xsl:with-param name="color" select="'imports'"/>
|
|---|
| 189 | </xsl:call-template>
|
|---|
| 190 | </xsl:when>
|
|---|
| 191 | <xsl:when test="$currentmodule//import[@name eq $module/@name]">
|
|---|
| 192 | <xsl:call-template name="colored_module">
|
|---|
| 193 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 194 | <xsl:with-param name="color" select="'imports_ind'"/>
|
|---|
| 195 | </xsl:call-template>
|
|---|
| 196 | </xsl:when>
|
|---|
| 197 | <xsl:when test="$module/import[@name eq $currentmodule/@name]">
|
|---|
| 198 | <xsl:call-template name="colored_module">
|
|---|
| 199 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 200 | <xsl:with-param name="color" select="'importedby'"/>
|
|---|
| 201 | </xsl:call-template>
|
|---|
| 202 | </xsl:when>
|
|---|
| 203 | <xsl:when test="$module//import[@name eq $currentmodule/@name]">
|
|---|
| 204 | <xsl:call-template name="colored_module">
|
|---|
| 205 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 206 | <xsl:with-param name="color" select="'importedby_ind'"/>
|
|---|
| 207 | </xsl:call-template>
|
|---|
| 208 | </xsl:when>
|
|---|
| 209 | <xsl:otherwise>
|
|---|
| 210 | <xsl:call-template name="colored_module">
|
|---|
| 211 | <xsl:with-param name="module" select="$module"/>
|
|---|
| 212 | <xsl:with-param name="color" select="'normal'"/>
|
|---|
| 213 | </xsl:call-template>
|
|---|
| 214 | </xsl:otherwise>
|
|---|
| 215 | </xsl:choose>
|
|---|
| 216 | </xsl:template>
|
|---|
| 217 | <xsl:template name="colored_module">
|
|---|
| 218 | <xsl:param name="module"/>
|
|---|
| 219 | <xsl:param name="color"/>
|
|---|
| 220 | <a href="{concat('import_', $module/@name, '.html')}" class="{$color}"><xsl:value-of select="$module/@name"/></a>
|
|---|
| 221 | </xsl:template>
|
|---|
| 222 |
|
|---|
| 223 | <xsl:template match="import_behaviour">
|
|---|
| 224 | <xsl:apply-templates/>
|
|---|
| 225 | </xsl:template>
|
|---|
| 226 |
|
|---|
| 227 | <xsl:template name="html_head">
|
|---|
| 228 | <xsl:param name="title"/>
|
|---|
| 229 | <head>
|
|---|
| 230 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
|---|
| 231 | <link rel="stylesheet" type="text/css" href="css/doc.css"/>
|
|---|
| 232 | <xsl:choose>
|
|---|
| 233 | <xsl:when test="$showOriginalT3DocTags eq 'true'">
|
|---|
| 234 | <style type="text/css">
|
|---|
| 235 | .span_tagtype{
|
|---|
| 236 | display:none;
|
|---|
| 237 | }
|
|---|
| 238 | </style>
|
|---|
| 239 | </xsl:when>
|
|---|
| 240 | <xsl:otherwise>
|
|---|
| 241 | <style type="text/css">
|
|---|
| 242 | .span_tagtypeOrig{
|
|---|
| 243 | display:none;
|
|---|
| 244 | }
|
|---|
| 245 | </style>
|
|---|
| 246 | </xsl:otherwise>
|
|---|
| 247 | </xsl:choose>
|
|---|
| 248 | <script type="text/javascript" src="js/doc.js"></script>
|
|---|
| 249 | <script type="text/javascript" src="js/index.js"></script>
|
|---|
| 250 | <title><xsl:value-of select="$title"/></title>
|
|---|
| 251 | </head>
|
|---|
| 252 | </xsl:template>
|
|---|
| 253 |
|
|---|
| 254 | <xsl:template match="link">
|
|---|
| 255 | <xsl:variable name="loc" select="@loc" />
|
|---|
| 256 | <a href="{@loc}"><xsl:value-of select="replace(replace(text(), ' ', ' '), '\t', '	')"/></a>
|
|---|
| 257 | </xsl:template>
|
|---|
| 258 |
|
|---|
| 259 | <xsl:template name="legend">
|
|---|
| 260 | <div id="div_index">
|
|---|
| 261 | <p>Legend:</p>
|
|---|
| 262 | <p class="padding_left_10px">
|
|---|
| 263 | <span class="imports">Selected module imports this module</span>
|
|---|
| 264 | <br/>
|
|---|
| 265 | <br/>
|
|---|
| 266 | <span class="imports_ind">Selected module indirectly depends on this module</span>
|
|---|
| 267 | <br/>
|
|---|
| 268 | <br/>
|
|---|
| 269 | <span class="importedby">Selected module is imported by this module</span>
|
|---|
| 270 | <br/>
|
|---|
| 271 | <br/>
|
|---|
| 272 | <span class="importedby_ind">This module indirectly depends on the selected module</span>
|
|---|
| 273 | <br/>
|
|---|
| 274 | <br/>
|
|---|
| 275 | <span class="selected">Selected module</span>
|
|---|
| 276 | </p>
|
|---|
| 277 | </div>
|
|---|
| 278 | </xsl:template>
|
|---|
| 279 |
|
|---|
| 280 | </xsl:stylesheet> |
|---|