Cleanup xsl. Use templates and proper indentation so that this is actually human readable now.

This commit is contained in:
Steve Checkoway
2006-10-01 08:56:25 +00:00
parent 9a936c8aaf
commit 49645f302c
+74 -30
View File
@@ -3,7 +3,7 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Lua">
<xsl:template match="/">
<html>
<head>
<title>StepMania LUA Information</title>
@@ -18,9 +18,15 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
td {
border: 1px solid
}
hr {
width: 90%
}
.trigger {
cursor: pointer
}
.footer {
text-align: center
}
</style>
<script type="text/javascript">
function Toggle( id )
@@ -44,36 +50,69 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</script>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="Lua">
<div>
<h2>StepMania LUA Information</h2>
<table><tr>
<table>
<tr>
<th><a href="#Singletons">Singletons</a></th>
<th><a href="#Classes">Classes</a></th>
<th><a href="#GlobalFunctions">Global Functions</a></th>
<th><a href="#Enums">Enums</a></th>
<th><a href="#Constants">Constants</a></th>
</tr></table>
</tr>
</table>
</div>
<xsl:apply-templates select="Singletons" />
<xsl:apply-templates select="Classes" />
<xsl:apply-templates select="GlobalFunctions" />
<xsl:apply-templates select="Enums" />
<xsl:apply-templates select="Constants" />
<hr />
<p class="footer">
Generated for <xsl:value-of select="Version" /> on
<xsl:value-of select="Date" />.
</p>
</xsl:template>
<xsl:template match="Singletons">
<div>
<a name="Singletons" />
<h3>Singletons</h3>
<ul>
<xsl:for-each select="Singletons/Singleton">
<xsl:for-each select="Singleton">
<xsl:sort select="@name" />
<li><a>
<li>
<a>
<xsl:attribute name="href">#<xsl:value-of select="@class" /></xsl:attribute>
<xsl:value-of select="@name" />
</a></li>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
<xsl:template match="Classes">
<div>
<a name="Classes" />
<h3>Classes</h3>
<xsl:for-each select="Classes/Class">
<xsl:apply-templates select="Class">
<xsl:sort select="@name" />
</xsl:apply-templates>
</div>
</xsl:template>
<xsl:template match="Class">
<div>
<a>
<xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute>
@@ -83,40 +122,53 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<img src="closed.gif">
<xsl:attribute name="id">img_<xsl:value-of select="@name" /></xsl:attribute>
</img>
Class <xsl:value-of select="@name" /></a>
Class <xsl:value-of select="@name" />
</a>
<xsl:if test="@base != ''">
: <a>
<xsl:text> : </xsl:text>
<a>
<xsl:attribute name="href">#<xsl:value-of select="@base" /></xsl:attribute>
<xsl:value-of select="@base" />
</a>
</xsl:if>
<ul style="display: none">
<xsl:attribute name="id">list_<xsl:value-of select="@name" /></xsl:attribute>
<xsl:for-each select="Function">
<xsl:apply-templates select="Function">
<xsl:sort select="@name" />
<li><xsl:value-of select="@name" /></li>
</xsl:for-each>
</xsl:apply-templates>
</ul>
</div>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="GlobalFunctions">
<div>
<a name="GlobalFunctions" />
<h3>Global Functions</h3>
<ul>
<xsl:for-each select="GlobalFunctions/Function">
<xsl:apply-templates select="Function">
<xsl:sort select="@name" />
<li><xsl:value-of select="@name" /></li>
</xsl:for-each>
</xsl:apply-templates>
</ul>
</div>
</xsl:template>
<xsl:template match="Function">
<li><xsl:value-of select="@name" /></li>
</xsl:template>
<xsl:template match="Enums">
<div>
<a name="Enums" />
<h3>Enums</h3>
<xsl:for-each select="Enums/Enum">
<xsl:apply-templates select="Enum">
<xsl:sort select="@name" />
</xsl:apply-templates>
</div>
</xsl:template>
<xsl:template match="Enum">
<div>
<a class="trigger">
<xsl:attribute name="onClick">Toggle('<xsl:value-of select="@name" />')</xsl:attribute>
@@ -140,9 +192,10 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</table>
<br />
</div>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="Constants">
<div>
<a name="Constants" />
<h3>Constants</h3>
@@ -151,7 +204,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<th>Constant</th>
<th>Value</th>
</tr>
<xsl:for-each select="Constants/Constant">
<xsl:for-each select="Constant">
<xsl:sort select="@name" />
<tr>
<td><xsl:value-of select="@name" /></td>
@@ -161,14 +214,5 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</table>
<br />
</div>
<hr width="90%" />
<center>
<p>Generated for <xsl:value-of select="Version" /> on
<xsl:value-of select="Date" />.</p>
</center>
</body>
</html>
</xsl:template>
</xsl:stylesheet>