Mainly tidying up of auto-generated documentation

This commit is contained in:
sb 2008-07-08 11:25:11 +00:00
parent f13185de34
commit 62168723e1
3 changed files with 194 additions and 66 deletions

37
documentation.css Executable file
View file

@ -0,0 +1,37 @@
/******************************************************
* Application Description Language framework
* adl2documentation.xslt
*
* (c) 2007 Cygnet Solutions Ltd
*
* Produce basic documentation of an ADL file
*
* $Author: sb $
* $Revision: 1.1 $
*
******************************************************/
BODY
{
color: Black;
background-color: White;
font-family: Sans-Serif;
}
TD, TH
{
text-align: left;
vertical-align: top;
padding: 0.1em 0.5em;
}
.documentation
{
font-style: italic;
}
.odd
{
color: Black;
background-color: Silver;
}

View file

@ -20,8 +20,8 @@
explicitly state the permission, even if it is 'none'. explicitly state the permission, even if it is 'none'.
$Author: sb $ $Author: sb $
$Revision: 1.1 $ $Revision: 1.2 $
$Date: 2008-05-29 16:39:39 $ $Date: 2008-07-08 11:25:11 $
--> -->
<xsl:stylesheet version="1.0" <xsl:stylesheet version="1.0"
@ -68,7 +68,7 @@
* THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT * THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD NOT
* BE MANUALLY EDITED. * BE MANUALLY EDITED.
* *
* Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.1 $', 12)"/> * Generated using adl2canonical.xslt <xsl:value-of select="substring('$Revision: 1.2 $', 12)"/>
* *
*************************************************************************** ***************************************************************************
</xsl:comment> </xsl:comment>
@ -177,7 +177,7 @@
</xsl:if> </xsl:if>
<!-- generate one property, the abstract primary key --> <!-- generate one property, the abstract primary key -->
<property type="integer" distinct="system"> <property type="integer" distinct="system" required="true">
<xsl:attribute name="name"> <xsl:attribute name="name">
<xsl:value-of select="normalize-space( $key)"/> <xsl:value-of select="normalize-space( $key)"/>
</xsl:attribute> </xsl:attribute>

View file

@ -28,6 +28,7 @@
</xsl:if> </xsl:if>
</head> </head>
<body> <body>
<address name="top"/>
<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>
@ -40,7 +41,7 @@
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="concat( '#entity-', @name)"/> <xsl:value-of select="concat( '#entity-', @name)"/>
</xsl:attribute> </xsl:attribute>
Entity '<xsl:value-of select="@name"/>' <xsl:value-of select="@name"/>
</a> </a>
</dt> </dt>
<dd> <dd>
@ -59,47 +60,78 @@
<xsl:value-of select="@name" /> <xsl:value-of select="@name" />
</h2> </h2>
<xsl:apply-templates select="adl:documentation"/> <xsl:apply-templates select="adl:documentation"/>
<dl> <h3>Access control</h3>
<table>
<tr>
<th>Group</th>
<th>Permission</th>
</tr>
<xsl:for-each select="adl:permission"> <xsl:for-each select="adl:permission">
<dt> <tr>
Group: <td>
<xsl:value-of select="@group"/> <xsl:value-of select="@group"/>
</dt> </td>
<dd> <td>
Permissions:
<xsl:value-of select="@permission"/> <xsl:value-of select="@permission"/>
</dd> </td>
</tr>
</xsl:for-each> </xsl:for-each>
</dl> </table>
<h3>Properties</h3>
<table> <table>
<tr class="header"> <tr class="header">
<th class="white">Property</th> <th>Property</th>
<th class="white">Type</th> <th>Type</th>
<xsl:if test="$detail = 'full'"> <xsl:if test="$detail = 'full'">
<th class="white">Req'd</th> <th>Req'd</th>
<th class="white">Def'lt</th> <th>Def'lt</th>
<th class="white">Size</th> <th>Size</th>
<th class="white">Distinct</th> <th>Distinct</th>
<th class="white">Prompt</th> <th>Prompt</th>
</xsl:if> </xsl:if>
</tr> </tr>
<xsl:for-each select="adl:property" > <xsl:for-each select=".//adl:property" >
<tr> <xsl:variable name="rowclass">
<xsl:attribute name="class">
<xsl:choose> <xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when> <xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise> <xsl:otherwise>odd</xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable>
<tr>
<xsl:attribute name="class">
<xsl:value-of select="$rowclass"/>
</xsl:attribute> </xsl:attribute>
<td> <th>
<xsl:value-of select="@name"/>&#160; <xsl:value-of select="@name"/>&#160;
</td> </th>
<td> <td>
<xsl:value-of select="@type"/> <xsl:value-of select="@type"/>
<xsl:if test="@type='entity'"> <xsl:choose>
of type <xsl:value-of select="@entity"/> <xsl:when test="@type='entity'">
</xsl:if> of type <a>
<xsl:if test="@definition"> <xsl:attribute name="href">
<xsl:value-of select="concat( '#entity-', @entity)"/>
</xsl:attribute>
<xsl:value-of select="@entity"/>
</a>
</xsl:when>
<xsl:when test="@type = 'link'">
to entity of type <a>
<xsl:attribute name="href">
<xsl:value-of select="concat( '#entity-', @entity)"/>
</xsl:attribute>
<xsl:value-of select="@entity"/>
</a>
</xsl:when>
<xsl:when test="@type = 'list'">
of entities of type <a>
<xsl:attribute name="href">
<xsl:value-of select="concat( '#entity-', @entity)"/>
</xsl:attribute>
<xsl:value-of select="@entity"/>
</a>
</xsl:when>
<xsl:when test="@definition">
: :
<xsl:variable name="definition"> <xsl:variable name="definition">
<xsl:value-of select="@definition"/> <xsl:value-of select="@definition"/>
@ -118,8 +150,8 @@
<xsl:value-of select="/adl:application/adl:definition[@name=$definition]/@maximum"/> <xsl:value-of select="/adl:application/adl:definition[@name=$definition]/@maximum"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:if> </xsl:when>
&#160; </xsl:choose>
</td> </td>
<xsl:if test="$detail = 'full'"> <xsl:if test="$detail = 'full'">
<td> <td>
@ -141,26 +173,75 @@
</td> </td>
</xsl:if> </xsl:if>
</tr> </tr>
<xsl:if test="adl:option">
<tr>
<xsl:attribute name="class">
<xsl:value-of select="$rowclass"/>
</xsl:attribute>
<td>
<xsl:attribute name="rowspan">
<xsl:value-of select="count( adl:option)"/>
</xsl:attribute>
Options:
</td>
<td>
<xsl:apply-templates select="adl:option[ position()=1]"/>
</td>
<xsl:for-each select="adl:option[position() &gt; 1]">
<tr>
<xsl:attribute name="class">
<xsl:value-of select="$rowclass"/>
</xsl:attribute>
<td>
<xsl:apply-templates select="."/>
</td>
</tr>
</xsl:for-each>
</tr>
</xsl:if>
<xsl:if test="adl:help"> <xsl:if test="adl:help">
<tr> <tr>
<xsl:attribute name="class">
<xsl:value-of select="$rowclass"/>
</xsl:attribute>
<td> <td>
<xsl:apply-templates select="adl:help"/>&#160; <td>Helptext:</td>
<td>
<xsl:attribute name="colspan">
<xsl:choose>
<xsl:when test="$detail='full'">7</xsl:when>
<xsl:otherwise>2</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="adl:help"/>
</td>
</td> </td>
</tr> </tr>
</xsl:if> </xsl:if>
<xsl:if test="adl:documentation"> <xsl:if test="adl:documentation">
<tr> <tr>
<td colspan="8"> <xsl:attribute name="class">
<xsl:apply-templates select="adl:documentation"/>&#160; <xsl:value-of select="$rowclass"/>
</xsl:attribute>
<td>Documentation:</td>
<td>
<xsl:attribute name="colspan">
<xsl:choose>
<xsl:when test="$detail='full'">7</xsl:when>
<xsl:otherwise>2</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="adl:documentation"/>
</td> </td>
</tr> </tr>
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
</table> </table>
</xsl:for-each>
<xsl:apply-templates select="form"/> <xsl:apply-templates select="form"/>
<xsl:apply-templates select="list"/> <xsl:apply-templates select="list"/>
<xsl:apply-templates select="page"/> <xsl:apply-templates select="page"/>
<a href="#top">[back to top]</a>
</xsl:for-each>
</body> </body>
</html> </html>
</xsl:template> </xsl:template>
@ -458,7 +539,17 @@
<xsl:apply-templates select="adl:field|adl:fieldgroup|adl:auxlist|adl:verb"/> <xsl:apply-templates select="adl:field|adl:fieldgroup|adl:auxlist|adl:verb"/>
</xsl:template> </xsl:template>
<xsl:template match="adl:option">
<xsl:value-of select="@value"/>
<xsl:if test="adl:prompt">
: <xsl:apply-templates select="adl:prompt"/>
</xsl:if>
<xsl:if test="adl:help">
(<i xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="adl:prompt"/>
</i>)
</xsl:if>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>