From 3e8306ca6c53fb424692339d8af62ffb5bdd2057 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 13 May 2009 17:52:33 +0000 Subject: [PATCH] pass locale into named templates as parem; major improvements to auto-documentation --- transforms/adl2documentation.xslt | 709 ++++++++++++++++++------------ transforms/adl2views.xslt | 22 +- 2 files changed, 452 insertions(+), 279 deletions(-) diff --git a/transforms/adl2documentation.xslt b/transforms/adl2documentation.xslt index 4393f89..31da60d 100755 --- a/transforms/adl2documentation.xslt +++ b/transforms/adl2documentation.xslt @@ -14,7 +14,7 @@ - + Data definition for the <xsl:value-of select="@name"/> application @@ -42,232 +42,353 @@ </xsl:if> <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> - <xsl:value-of select="@name"/> - </a> - </dt> - <dd> - <xsl:value-of select="adl:documentation"/> - </dd> - </xsl:for-each> - </dl> - <xsl:for-each select="adl:entity"> - <a> - <xsl:attribute name="name"> - <xsl:value-of select="concat( 'entity-', @name)"/> - </xsl:attribute> - </a> - <hr/> - <h2> - <xsl:value-of select="@name" /> - </h2> - <xsl:apply-templates select="adl:documentation"/> - <h3>Access control</h3> - <table> - <tr> - <th>Group</th> - <th>Permission</th> - </tr> - <xsl:for-each select="adl:permission"> - <tr> - <td> - <xsl:value-of select="@group"/> - </td> - <td> - <xsl:value-of select="@permission"/> - </td> - </tr> - </xsl:for-each> - </table> - <h3>Properties</h3> - <table> - <tr class="header"> - <th>Property</th> - <th>Type</th> - <xsl:if test="$detail = 'full'"> - <th>Req'd</th> - <th>Def'lt</th> - <th>Size</th> - <th>Distinct</th> - <th>Prompt</th> - </xsl:if> - </tr> - <xsl:for-each select=".//adl:property" > - <xsl:variable name="rowclass"> - <xsl:choose> - <xsl:when test="position() mod 2 = 0">even</xsl:when> - <xsl:otherwise>odd</xsl:otherwise> - </xsl:choose> - </xsl:variable> - <tr> - <xsl:attribute name="class"> - <xsl:value-of select="$rowclass"/> - </xsl:attribute> - <th> - <xsl:value-of select="@name"/>  - </th> - <td> - <xsl:value-of select="@type"/> - <xsl:choose> - <xsl:when test="@type='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 = 'link'"> - (many to many) to 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="@type = 'list'"> - <xsl:choose> - <xsl:when test="@required='true'"> - (one to one-or-many) - </xsl:when> - <xsl:otherwise> - (one to zero-or-many) - </xsl:otherwise> - </xsl:choose> - 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:value-of select="@definition"/> - </xsl:variable> - <xsl:variable name="defined-type"> - <xsl:value-of select="/adl:application/adl:definition[@name=$definition]/@type"/> - </xsl:variable> - <xsl:choose> - <xsl:when test="$defined-type = 'string'"> - String matching - "<xsl:value-of select="/adl:application/adl:definition[@name=$definition]/@pattern"/>" - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="/adl:application/adl:definition[@name=$definition]/@minimum"/> < - <xsl:value-of select="@definition"/> < - <xsl:value-of select="/adl:application/adl:definition[@name=$definition]/@maximum"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - </xsl:choose> - </td> - <xsl:if test="$detail = 'full'"> - <td> - <xsl:value-of select="@required"/>  - </td> - <td> - <xsl:value-of select="@default"/>  - </td> - <td> - <xsl:value-of select="@size"/>  - </td> - <td> - <xsl:value-of select="@distinct"/>  - </td> - <td> - <xsl:for-each select="adl:prompt"> - <xsl:apply-templates select="adl:prompt"/>  - </xsl:for-each> - </td> - </xsl:if> - </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() > 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"> - <tr> - <xsl:attribute name="class"> - <xsl:value-of select="$rowclass"/> - </xsl:attribute> - <td> - <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> - </tr> - </xsl:if> - <xsl:if test="adl:documentation"> - <tr> - <xsl:attribute name="class"> - <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> - </tr> - </xsl:if> - </xsl:for-each> - </table> - <xsl:apply-templates select="form"/> - <xsl:apply-templates select="list"/> - <xsl:apply-templates select="page"/> - <a href="#top">[back to top]</a> - </xsl:for-each> + <dl> + <dt>Entities</dt> + <dd> + <dl> + <xsl:for-each select="adl:entity"> + <dt> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#entity-', @name)"/> + </xsl:attribute> + <xsl:value-of select="@name"/> + </a> + </dt> + <dd> + <xsl:value-of select="adl:documentation"/> + </dd> + </xsl:for-each> + </dl> + </dd> + <dt>Defined types</dt> + <dd> + <dl> + <xsl:for-each select="adl:typedef"> + <dt> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#typedef-', @name)"/> + </xsl:attribute> + <xsl:value-of select="@name"/> + </a> + </dt> + </xsl:for-each> + </dl> + </dd> + <dt>Security groups</dt> + <dd> + <dl> + <xsl:for-each select="adl:group"> + <dt> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#group-', @name)"/> + </xsl:attribute> + <xsl:value-of select="@name"/> + </a> + </dt> + </xsl:for-each> + </dl> + </dd> + </dl> + <hr/> + <h2>Entities</h2> + <xsl:apply-templates select="adl:entity"/> + <hr/> + <h2> + Type Definitions + </h2> + <xsl:apply-templates select="adl:typedef"/> + <hr/> + <h2>Security groups</h2> + <xsl:apply-templates select="adl:group"/> </body> </html> </xsl:template> + <xsl:template match="adl:entity"> + <hr/> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat( 'entity-', @name)"/> + </xsl:attribute> + </a> + <h3> + <xsl:value-of select="@name" /> + </h3> + <xsl:apply-templates select="adl:documentation"/> + <h4>Access control</h4> + <table> + <tr> + <th>Group</th> + <th>Permission</th> + </tr> + <xsl:for-each select="adl:permission"> + <tr> + <td> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#group-', @group)"/> + </xsl:attribute> + <xsl:value-of select="@group"/> + </a> + </td> + <td> + <xsl:value-of select="@permission"/> + </td> + </tr> + </xsl:for-each> + </table> + <h4>User interface</h4> + <ul> + <xsl:for-each select="adl:page|adl:list|adl:form"> + <li> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#page-', ancestor::adl:entity/@name, '-', @name)"/> + </xsl:attribute> + <xsl:value-of select="@name"/> + </a> + </li> + </xsl:for-each> + </ul> + <h4>Properties</h4> + <table> + <tr class="header"> + <th>Property</th> + <th>Type</th> + <xsl:if test="not( $detail) or $detail = 'full'"> + <th>Req'd</th> + <th>Def'lt</th> + <th>Size</th> + <th>Distinct</th> + <th>Prompt</th> + <th>Security overrides</th> + </xsl:if> + </tr> + <xsl:apply-templates select=".//adl:property" /> + </table> + <xsl:apply-templates select="adl:form"/> + <xsl:apply-templates select="adl:list"/> + <xsl:apply-templates select="adl:page"/> + <a href="#top">[back to top]</a> + </xsl:template> + + <xsl:template match="adl:property"> + <xsl:variable name="rowclass"> + <xsl:choose> + <xsl:when test="position() mod 2 = 0">even</xsl:when> + <xsl:otherwise>odd</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <tr> + <xsl:attribute name="class"> + <xsl:value-of select="$rowclass"/> + </xsl:attribute> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat( 'property-', ancestor::adl:entity/@name, '-', @name)"/> + </xsl:attribute> + </a> + <th> + <xsl:value-of select="@name"/>  + </th> + <td> + <xsl:value-of select="@type"/> + <xsl:choose> + <xsl:when test="@type='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 = 'link'"> + (many to many) to 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="@type = 'list'"> + <xsl:choose> + <xsl:when test="@required='true'"> + (one to one-or-many) + </xsl:when> + <xsl:otherwise> + (one to zero-or-many) + </xsl:otherwise> + </xsl:choose> + 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="@type='defined'"> + as <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#typedef-', @typedef)"/> + </xsl:attribute> + <xsl:value-of select="@typedef"/> + </a> + </xsl:when> + </xsl:choose> + </td> + <xsl:if test="not( $detail) or $detail = 'full'"> + <td> + <xsl:value-of select="@required"/>  + </td> + <td> + <xsl:value-of select="@default"/>  + </td> + <td> + <xsl:value-of select="@size"/>  + </td> + <td> + <xsl:value-of select="@distinct"/>  + </td> + <td> + <xsl:apply-templates select="adl:prompt"/>  + </td> + <td> + <dl> + <xsl:for-each select="adl:permission"> + <dt> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#group-', @group)"/> + </xsl:attribute> + <xsl:value-of select="@group"/> + </a> + </dt> + <dd> + <xsl:value-of select="@permission"/> + </dd> + </xsl:for-each> + </dl> + </td> + </xsl:if> + </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 colspan="7"> + <xsl:apply-templates select="adl:option[ position()=1]"/> + </td> + <xsl:for-each select="adl:option[position() > 1]"> + <tr> + <xsl:attribute name="class"> + <xsl:value-of select="$rowclass"/> + </xsl:attribute> + <td colspan="7"> + <xsl:apply-templates select="."/> + </td> + </tr> + </xsl:for-each> + </tr> + </xsl:if> + <xsl:if test="adl:help"> + <tr> + <xsl:attribute name="class"> + <xsl:value-of select="$rowclass"/> + </xsl:attribute> + <td> + <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> + </tr> + </xsl:if> + <xsl:if test="adl:documentation"> + <tr> + <xsl:attribute name="class"> + <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> + </tr> + </xsl:if> + </xsl:template> + + <xsl:template match="adl:typedef"> + <hr/> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat( 'typedef-', @name)"/> + </xsl:attribute> + </a> + <h3> + <xsl:value-of select="@name" /> + </h3> + <p> + <xsl:choose> + <xsl:when test="@type = 'string'"> + String matching + "<xsl:value-of select="@pattern"/>" + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@minimum"/> < + <xsl:value-of select="@typedef"/> < + <xsl:value-of select="@maximum"/> + </xsl:otherwise> + </xsl:choose> + </p> + <xsl:apply-templates select="adl:documentation"/> + <a href="#top">[back to top]</a> + </xsl:template> + + <xsl:template match="adl:group"> + <hr/> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat( 'group-', @name)"/> + </xsl:attribute> + </a> + <h3> + <xsl:value-of select="@name" /> + </h3> + <xsl:apply-templates select="adl:documentation"/> + <a href="#top">[back to top]</a> + </xsl:template> + <xsl:template match="adl:prompt"> <!-- If I'm the prompt for the current locale, show me; if I'm the default prompt, show me only if there isn't one for the default locale --> <xsl:choose> - <xsl:when test="@locale=$locale"> + <xsl:when test="not($locale) and @locale='en-GB'"> + <!-- something's not right with the locale parameter? --> + <xsl:apply-templates/> + </xsl:when> + <xsl:when test="@locale=$locale"> <xsl:value-of select="@prompt"/> </xsl:when> <xsl:when test="@locale='default'"> @@ -279,6 +400,7 @@ </xsl:choose> </xsl:when> </xsl:choose> + <xsl:apply-templates/> </xsl:template> <xsl:template match="adl:help"> @@ -286,6 +408,10 @@ if I'm the default helptext, show me only if there isn't one for the default locale --> <xsl:choose> + <xsl:when test="not($locale) and @locale='en-GB'"> + <!-- something's not right with the locale parameter? --> + <xsl:apply-templates/> + </xsl:when> <xsl:when test="@locale=$locale"> <xsl:apply-templates/> </xsl:when> @@ -301,10 +427,10 @@ </xsl:template> <xsl:template match="adl:documentation"> - <div xmlns="http://www.w3.org/1999/xhtml" class="documentation"> + <div class="documentation"> <xsl:value-of select="."/> <xsl:if test="adl:reference"> - <h4>See also</h4> + <h5>See also</h5> <ul> <xsl:apply-templates select="adl:reference"/> </ul> @@ -315,7 +441,7 @@ <xsl:template match="adl:reference"> <xsl:variable name="abbr" select="@abbr"/> <xsl:variable name="specification" select="/adl:application/adl:specification[@abbr=$abbr]"/> - <li xmlns="http://www.w3.org/1999/xhtml"> + <li> <xsl:choose> <xsl:when test="@entity"> <a> @@ -329,7 +455,7 @@ </a> </xsl:when> <xsl:when test="$specification/@url"> - <a xmlns="http://www.w3.org/1999/xhtml"> + <a> <xsl:attribute name="href"> <xsl:choose> <xsl:when test="@section"> @@ -359,20 +485,31 @@ </xsl:template> <xsl:template match="adl:form"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h3 xmlns="http://www.w3.org/1999/xhtml"> - Form <xsl:value-of select="@name"/> - </h3> + <div class="form"> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat('page-', ancestor::adl:entity/@name, '-', @name)"/> + </xsl:attribute> + </a> + <h4> + Form '<xsl:value-of select="@name"/>' of entity + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat('#entity-', ancestor::adl:entity/@name)"/> + </xsl:attribute> + <xsl:value-of select="ancestor::adl:entity/@name"/> + </a> + </h4> <xsl:if test="adl:permission"> - <h4 xmlns="http://www.w3.org/1999/xhtml">Permissions</h4> - <ul xmlns="http://www.w3.org/1999/xhtml"> + <h5>Permissions</h5> + <ul> <xsl:apply-templates select="permission"/> </ul> </xsl:if> <xsl:choose> <xsl:when test="@properties='listed'"> <p>Showing the following properties</p> - <table xmlns="http://www.w3.org/1999/xhtml"> + <table> <tr> <th> </th> <th>Property</th> @@ -390,19 +527,30 @@ </xsl:template> <xsl:template match="adl:page"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h3 xmlns="http://www.w3.org/1999/xhtml"> - Page <xsl:value-of select="@name"/> - </h3> + <div class="page"> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat('page-', ancestor::adl:entity/@name, '-', @name)"/> + </xsl:attribute> + </a> + <h4> + Page '<xsl:value-of select="@name"/>' of entity + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat('#entity-', ancestor::adl:entity/@name)"/> + </xsl:attribute> + <xsl:value-of select="ancestor::adl:entity/@name"/> + </a> + </h4> <xsl:if test="adl:permission"> - <ul xmlns="http://www.w3.org/1999/xhtml"> + <ul> <xsl:apply-templates select="permission"/> </ul> </xsl:if> <xsl:choose> <xsl:when test="@properties='listed'"> <p>Showing the following properties</p> - <table xmlns="http://www.w3.org/1999/xhtml"> + <table> <tr> <th> </th> <th>Property</th> @@ -420,19 +568,36 @@ </xsl:template> <xsl:template match="adl:list"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h3 xmlns="http://www.w3.org/1999/xhtml"> - List <xsl:value-of select="@name"/>, on select <xsl:value-of select="@onselect"/> - </h3> + <div class="list"> + <a> + <xsl:attribute name="name"> + <xsl:value-of select="concat('page-', ancestor::adl:entity/@name, '-', @name)"/> + </xsl:attribute> + </a> + <h4> + List '<xsl:value-of select="@name"/>' of entity + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat('#entity-', ancestor::adl:entity/@name)"/> + </xsl:attribute> + <xsl:value-of select="ancestor::adl:entity/@name"/> + </a>, on select + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#page-', ancestor::adl:entity/@name, '-', @onselect)"/> + </xsl:attribute> + <xsl:value-of select="@onselect"/> + </a> + </h4> <xsl:if test="adl:permission"> - <ul xmlns="http://www.w3.org/1999/xhtml"> + <ul> <xsl:apply-templates select="adl:permission"/> </ul> </xsl:if> <xsl:choose> <xsl:when test="@properties='listed'"> <p>Showing the following properties</p> - <table xmlns="http://www.w3.org/1999/xhtml"> + <table> <tr> <th> </th> <th>Property</th> @@ -450,7 +615,7 @@ </xsl:template> <xsl:template match="adl:field"> - <tr xmlns="http://www.w3.org/1999/xhtml"> + <tr> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="parent::adl:fieldgroup"> @@ -469,7 +634,12 @@ </xsl:attribute> <td>Field</td> <td> - <xsl:value-of select="@property"/> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat( '#property-', ancestor::adl:entity/@name, '-', @property)"/> + </xsl:attribute> + <xsl:value-of select="@property"/> + </a> </td> <td> <xsl:apply-templates select="adl:prompt"/> @@ -482,7 +652,7 @@ </td> </tr> <xsl:if test="adl:permission"> - <tr xmlns="http://www.w3.org/1999/xhtml"> + <tr> <td></td> <td colspan="3"> <xsl:apply-templates select="adl:permission"/> @@ -493,7 +663,7 @@ <xsl:template match="adl:verb"> - <tr xmlns="http://www.w3.org/1999/xhtml"> + <tr> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="parent::adl:fieldgroup"> @@ -526,7 +696,7 @@ </td> </tr> <xsl:if test="adl:permission"> - <tr xmlns="http://www.w3.org/1999/xhtml"> + <tr> <td></td> <td colspan="3"> <xsl:apply-templates select="adl:permission"/> @@ -538,7 +708,7 @@ <xsl:template match="adl:auxlist"> - <tr xmlns="http://www.w3.org/1999/xhtml" class="auxlist-start"> + <tr class="auxlist-start"> <th>Auxlist</th> <th> <xsl:value-of select="@property"/> @@ -553,10 +723,27 @@ <xsl:apply-templates select="adl:documentation"/> </th> </tr> - <tr xmlns="http://www.w3.org/1999/xhtml" class="auxlist"> - <th>On select:</th> + <tr class="auxlist"> + <th> + <xsl:if test="@onselect">On select:</xsl:if></th> <td> - <xsl:value-of select="@onselect"/> + <a> + <xsl:attribute name="href"> + <xsl:variable name="propname" select="@property"/> + <xsl:variable name="targetent"> + <xsl:choose> + <xsl:when test="ancestor::adl:entity//adl:property[@name=$propname]/@entity"> + <xsl:value-of select="ancestor::adl:entity//adl:property[@name=$propname]/@entity"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="ancestor::adl:entity/@name"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="concat( '#page-', $targetent, '-', @onselect)"/> + </xsl:attribute> + <xsl:value-of select="@onselect"/> + </a> </td> <td colspan="2"> <xsl:choose> @@ -573,8 +760,8 @@ </xsl:template> <xsl:template match="adl:fieldgroup"> - <tr xmlns="http://www.w3.org/1999/xhtml" class="fieldgroup-start"> - <th>Auxlist</th> + <tr class="fieldgroup-start"> + <th>Field group</th> <th> <xsl:value-of select="@name"/> </th> @@ -588,22 +775,6 @@ <xsl:apply-templates select="adl:documentation"/> </th> </tr> - <tr xmlns="http://www.w3.org/1999/xhtml" class="adl:auxlist"> - <th>On select:</th> - <td> - <xsl:value-of select="@onselect"/> - </td> - <td colspan="2"> - <xsl:choose> - <xsl:when test="@properties='listed'"> - Showing the following properties - </xsl:when> - <xsl:otherwise> - Showing all properties - </xsl:otherwise> - </xsl:choose> - </td> - </tr> <xsl:apply-templates select="adl:field|adl:fieldgroup|adl:auxlist|adl:verb"/> </xsl:template> @@ -613,7 +784,7 @@ : <xsl:apply-templates select="adl:prompt"/> </xsl:if> <xsl:if test="adl:help"> - (<i xmlns="http://www.w3.org/1999/xhtml"> + (<i> <xsl:apply-templates select="adl:prompt"/> </i>) </xsl:if> diff --git a/transforms/adl2views.xslt b/transforms/adl2views.xslt index fc65d85..ad10b99 100755 --- a/transforms/adl2views.xslt +++ b/transforms/adl2views.xslt @@ -15,28 +15,27 @@ Transform ADL into velocity view templates $Author: sb $ - $Revision: 1.60 $ - $Date: 2009-05-12 15:43:18 $ + $Revision: 1.61 $ + $Date: 2009-05-13 17:52:33 $ --> <!-- WARNING WARNING WARNING: Do NOT reformat this file! Whitespace (or lack of it) is significant! --> <xsl:include href="base-type-include.xslt"/> <xsl:include href="permissions-include.xslt"/> + <!-- bug 1896 : boilerplate text in views should be tailored to the locale of + the expected user. Unfortunately I haven't yet worked out how to do + conditional includes in XSLT, so this is a step on the way to a solution, + not a solution in itself. --> + <xsl:include href="i18n-en-GB-include.xslt"/> - <xsl:output method="xml" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/> + <xsl:output method="xml" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/> <!-- The locale for which these views are generated TODO: we need to generate views for each available locale, but this is not yet implemented. When it is we will almost certainly still need a 'default locale' --> <xsl:param name="locale" select="en-GB"/> - <!-- bug 1896 : boilerplate text in views should be tailored to the locale of - the expected user. Unfortunately I haven't yet worked out how to do - conditional includes in XSLT, so this is a step on the way to a solution, - not a solution in itself. --> - <xsl:include href="i18n-en-GB-include.xslt"/> - <!-- whether or not to auto-generate site navigation - by default, don't --> <xsl:param name="generate-site-navigation" select="'false'"/> @@ -288,6 +287,7 @@ <xsl:call-template name="head"/> <xsl:call-template name="generate-head-javascript"> <xsl:with-param name="form" select="."/> + <xsl:with-param name="locale" select="$locale"/> </xsl:call-template> ${StylesHelper.InstallStylesheet( "Epoch")} @@ -351,6 +351,7 @@ <xsl:call-template name="install-scripts"/> <xsl:call-template name="generate-head-javascript"> <xsl:with-param name="form" select="."/> + <xsl:with-param name="locale" select="$locale"/> </xsl:call-template> ${StylesHelper.InstallStylesheet( "Epoch")} @@ -1501,6 +1502,7 @@ <xsl:param name="form"> <!-- assumed to be an instance of adl:form --> </xsl:param> + <xsl:param name="locale"/> <script type='text/javascript' language='JavaScript1.2'> #if ( ${site-root}) var siteRoot = '$siteRoot'; @@ -1848,7 +1850,7 @@ Auto generated Velocity macro for <xsl:value-of select="@name"/>, generated from ADL. - Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.60 $', 10)"/> + Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.61 $', 10)"/> Generation parameters were: area-name: <xsl:value-of select="$area-name"/> default-url: <xsl:value-of select="$default-url"/>