Added an option to produce less detailed documentation; added table of contents to genrerated documentation

This commit is contained in:
sb 2008-07-04 16:10:29 +00:00
parent bf29e641bd
commit f13185de34

View file

@ -4,12 +4,14 @@
xmlns="http://cygnets.co.uk/schemas/adl-1.2" xmlns="http://cygnets.co.uk/schemas/adl-1.2"
xmlns:adl="http://cygnets.co.uk/schemas/adl-1.2" xmlns:adl="http://cygnets.co.uk/schemas/adl-1.2"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" method="html" indent="yes" /> <xsl:output encoding="UTF-8" method="xml" indent="yes" />
<xsl:param name="locale" select="en-UK"/> <xsl:param name="locale" select="en-UK"/>
<xsl:param name="css-stylesheet"/> <xsl:param name="css-stylesheet"/>
<xsl:param name="detail" select="full"/>
<xsl:template match="adl:application"> <xsl:template match="adl:application">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
@ -27,11 +29,32 @@
</head> </head>
<body> <body>
<h1> <h1>
Data definition for the <xsl:value-of select="@name"/> application version <xsl:value-of select="@version"/> Data definition for the '<xsl:value-of select="@name"/>' application version <xsl:value-of select="@version"/>
</h1> </h1>
<xsl:apply-templates select="adl:documentation"/> <xsl:apply-templates select="adl:documentation"/>
<h2>Contents</h2>
<dl>
<xsl:for-each select="adl:entity">
<dt>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat( '#entity-', @name)"/>
</xsl:attribute>
Entity '<xsl:value-of select="@name"/>'
</a>
</dt>
<dd>
<xsl:apply-templates select="adl:documentation"/>
</dd>
</xsl:for-each>
</dl>
<xsl:for-each select="adl:entity"> <xsl:for-each select="adl:entity">
<a>
<xsl:attribute name="name">
<xsl:value-of select="concat( 'entity-', @name)"/>
</xsl:attribute>
</a>
<hr/>
<h2> <h2>
<xsl:value-of select="@name" /> <xsl:value-of select="@name" />
</h2> </h2>
@ -52,11 +75,13 @@
<tr class="header"> <tr class="header">
<th class="white">Property</th> <th class="white">Property</th>
<th class="white">Type</th> <th class="white">Type</th>
<th class="white">Req'd</th> <xsl:if test="$detail = 'full'">
<th class="white">Def'lt</th> <th class="white">Req'd</th>
<th class="white">Size</th> <th class="white">Def'lt</th>
<th class="white">Distinct</th> <th class="white">Size</th>
<th class="white">Prompt</th> <th class="white">Distinct</th>
<th class="white">Prompt</th>
</xsl:if>
</tr> </tr>
<xsl:for-each select="adl:property" > <xsl:for-each select="adl:property" >
<tr> <tr>
@ -96,23 +121,25 @@
</xsl:if> </xsl:if>
&#160; &#160;
</td> </td>
<td> <xsl:if test="$detail = 'full'">
<xsl:value-of select="@required"/>&#160; <td>
</td> <xsl:value-of select="@required"/>&#160;
<td> </td>
<xsl:value-of select="@default"/>&#160; <td>
</td> <xsl:value-of select="@default"/>&#160;
<td> </td>
<xsl:value-of select="@size"/>&#160; <td>
</td> <xsl:value-of select="@size"/>&#160;
<td> </td>
<xsl:value-of select="@distinct"/>&#160; <td>
</td> <xsl:value-of select="@distinct"/>&#160;
<td> </td>
<xsl:for-each select="adl:prompt"> <td>
<xsl:apply-templates select="adl:prompt"/>&#160; <xsl:for-each select="adl:prompt">
</xsl:for-each> <xsl:apply-templates select="adl:prompt"/>&#160;
</td> </xsl:for-each>
</td>
</xsl:if>
</tr> </tr>
<xsl:if test="adl:help"> <xsl:if test="adl:help">
<tr> <tr>
@ -123,7 +150,7 @@
</xsl:if> </xsl:if>
<xsl:if test="adl:documentation"> <xsl:if test="adl:documentation">
<tr> <tr>
<td> <td colspan="8">
<xsl:apply-templates select="adl:documentation"/>&#160; <xsl:apply-templates select="adl:documentation"/>&#160;
</td> </td>
</tr> </tr>