Considerable progress on adjunct editing suite, but some lacunae remain.

This commit is contained in:
sb 2008-03-04 17:30:52 +00:00
parent 22567139f3
commit e423b325a4
4 changed files with 177 additions and 92 deletions

View file

@ -13,7 +13,7 @@
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!--
$Revision: 1.12 $
$Revision: 1.13 $
-->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
@ -109,8 +109,9 @@ that we can allow HTML block level entities within content elements -->
common SQL data types
geopos : a latitude/longitude pair (experimental and not yet implemented)
image : a raster image file, in jpeg|gif|png format (experimental, not yet implemented)
message : an internationalised message, having different translations for different locales
-->
<!ENTITY % SpecialDataTypes "geopos|image" >
<!ENTITY % SpecialDataTypes "geopos|image|message" >
<!-- all data types -->
<!ENTITY % AllDataTypes "%ComplexDataTypes;|%SimpleDataTypes;|%SpecialDataTypes;" >
@ -567,7 +568,7 @@ property[@type='entity']. TODO: Not complete, not yet strictly convinced it's th
to this list
-->
<!ELEMENT auxlist (documentation?, (prompt|%FieldStuff;)*)>
<!ATTLIST auxlist
<!ATTLIST auxlist %PageAttrs;
property CDATA #REQUIRED
onselect CDATA #IMPLIED
canadd %Boolean; #IMPLIED>

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes
$Author: sb $
$Revision: 1.11 $
$Date: 2008-03-03 17:35:28 $
$Revision: 1.12 $
$Date: 2008-03-04 17:30:52 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -61,7 +61,7 @@
with the revision number of the generated file if the generated file is
stored to CVS -->
<xsl:variable name="transform-rev1"
select="substring( '$Revision: 1.11 $', 11)"/>
select="substring( '$Revision: 1.12 $', 11)"/>
<xsl:variable name="transform-revision"
select="substring( $transform-rev1, 0, string-length( $transform-rev1) - 1)"/>
@ -521,6 +521,62 @@ namespace <xsl:value-of select="$controllerns"/> {
"<xsl:value-of select="concat( @name, '.auto.vm')"/>");
}
<xsl:if test="ancestor::adl:entity/adl:key/adl:property[@type='entity']">
<!-- if there's a key which is an entity, the actual entity can't be passed in.
So what will be passed in is the key value, from which we can find the entity -->
/// &lt;summary&gt;
/// Show the form named <xsl:value-of select="@name"/>, containing the indicated record. As
/// the primary key of the record is itself an entity, we need to first fetch that entity
/// &lt;/summary&gt;
<xsl:for-each select="ancestor::adl:entity/adl:key/adl:property">
<xsl:choose>
<xsl:when test="@type='entity'">
/// &lt;param name="<xsl:value-of select="concat( @name, '_Value')"/>"&gt;the key value of the key value of the record to show&lt;/param&gt;
</xsl:when>
<xsl:otherwise>
/// &lt;param name="<xsl:value-of select="@name"/>"&gt;the key value of the record to show&lt;/param&gt;
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
[AccessibleThrough(Verb.Get)]
public void <xsl:value-of select="@name"/>( <xsl:for-each select="ancestor::adl:entity/adl:key/adl:property">
<xsl:choose>
<xsl:when test="@type='entity'">
<xsl:call-template name="csharp-base-type">
<xsl:with-param name="property" select="."/>
</xsl:call-template>
<xsl:value-of select="concat( ' ', @name, '_Value')"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="csharp-base-type">
<xsl:with-param name="property" select="."/>
</xsl:call-template>
<xsl:value-of select="concat( ' ', @name)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not( position() = last())">,</xsl:if>
</xsl:for-each>) {
ISession hibernator =
NHibernateHelper.GetCurrentSession( <xsl:if test="$authentication-layer = 'Database'">Session[ NHibernateHelper.USERTOKEN],
Session[NHibernateHelper.PASSTOKEN]</xsl:if>);
this.<xsl:value-of select="@name"/>( <xsl:for-each select="ancestor::adl:entity/adl:key/adl:property">
<xsl:choose>
<xsl:when test="@type='entity'">
<xsl:variable name="entity" select="@entity"/>
hibernator.CreateCriteria(typeof(<xsl:value-of select="concat($entityns, '.', @entity)"/>))
.Add( Expression.Eq( "<xsl:value-of select="//adl:entity[@name=$entity]/adl:key/adl:property[position()=1]/@name"/>", <xsl:value-of select="concat( @name, '_Value')"/>))
.UniqueResult&lt;<xsl:value-of select="concat($entityns, '.', @entity)"/>&gt;()
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat( ' ', @name)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not( position() = last())">,</xsl:if>
</xsl:for-each>);
}
</xsl:if>
/// &lt;summary&gt;
/// Show the form named <xsl:value-of select="@name"/>, containing the indicated record
/// &lt;/summary&gt;
@ -599,6 +655,10 @@ namespace <xsl:value-of select="$controllerns"/> {
</xsl:template>
<xsl:template match="adl:key">
<!-- the key shouldn't be matched directly - at least, not in this implementation -->
</xsl:template>
<xsl:template name="menu">
<xsl:param name="property"/>
<xsl:variable name="ename" select="$property/@entity"/>

View file

@ -12,7 +12,7 @@
Convert ADL to MS-SQL
$Author: sb $
$Revision: 1.10 $
$Revision: 1.11 $
-->
<xsl:output indent="no" encoding="UTF-8" method="text"/>
@ -34,7 +34,7 @@
-- Application Description Language framework
--
-- Database for application <xsl:value-of select="@name"/> version <xsl:value-of select="@version"/>
-- Generated for MS-SQL 2000+ using adl2mssql.xslt <xsl:value-of select="substring('$Revision: 1.10 $', 12)"/>
-- Generated for MS-SQL 2000+ using adl2mssql.xslt <xsl:value-of select="substring('$Revision: 1.11 $', 12)"/>
--
-- Code generator (c) 2007 Cygnet Solutions Ltd
--
@ -181,7 +181,7 @@
-------------------------------------------------------------------------------------------------
CREATE TABLE "<xsl:value-of select="$table"/>"
(
<xsl:for-each select="descendant::adl:property[@type!='link' and @type != 'list']">
<xsl:for-each select="descendant::adl:property[not( @type='link' or @type = 'list' or @concrete='false')]">
<xsl:apply-templates select="."/>
<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
@ -200,9 +200,9 @@
</xsl:template>
<xsl:template match="adl:key">
<xsl:if test="adl:property">
<xsl:if test="adl:property[not( @concrete='false')]">
,
PRIMARY KEY( <xsl:for-each select="adl:property">"<xsl:call-template name="property-column-name">
PRIMARY KEY( <xsl:for-each select="adl:property[not( @concrete='false')]">"<xsl:call-template name="property-column-name">
<xsl:with-param name="property" select="."/>
</xsl:call-template>"<xsl:if test="position() != last()">, </xsl:if></xsl:for-each>)
</xsl:if>

View file

@ -12,8 +12,8 @@
Transform ADL into velocity view templates
$Author: sb $
$Revision: 1.7 $
$Date: 2008-03-03 17:35:28 $
$Revision: 1.8 $
$Date: 2008-03-04 17:30:52 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! -->
@ -27,17 +27,16 @@
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-UK"/>
<!--
The convention to use for naming auto-generated abstract primary keys. Known values are
Id - the autogenerated primary key, if any, is called just 'Id'
Name - the autogenerated primary key has the same name as the entity
NameId - the name of the auto generated primary key is the name of the entity followed by 'Id'
Name_Id - the name of the auto generated primary key is the name of the entity followed by '_Id'
-->
<xsl:param name="abstract-key-name-convention" select="Id"/>
<!-- whether or not to auto-generate site navigation - by default, don't -->
<xsl:param name="generate-site-navigation"/>
<!-- the current state of play is that we can only generate views with permissions for one group.
TODO: this isn't how it's supposed to be. It's supposed to be that at service time the system
checks which groups the current user is member of, and renders each widget with the most relaxed
permissions applicable to that user - but we don't yet have the parts in place to do that.
This variable selects which group's permissions should be used when generating widgets -->
<xsl:param name="permissions-group" select="public"/>
<!-- what's all this about? the objective is to get the revision number of the
transform into the output, /without/ getting that revision number overwritten
@ -45,7 +44,7 @@
stored to CVS -->
<xsl:variable name="transform-rev1"
select="substring( '$Revision: 1.7 $', 11)"/>
select="substring( '$Revision: 1.8 $', 11)"/>
<xsl:variable name="transform-revision"
select="substring( $transform-rev1, 0, string-length( $transform-rev1) - 1)"/>
@ -65,18 +64,10 @@
<xsl:template match="adl:entity">
<xsl:variable name="keyfield">
<xsl:choose>
<xsl:when test="$abstract-key-name-convention='Name'">
<xsl:value-of select="@name"/>
<xsl:when test="adl:key/adl:property">
<xsl:value-of select="adl:key/adl:property[position()=1]/@name"/>
</xsl:when>
<xsl:when test="$abstract-key-name-convention = 'NameId'">
<xsl:value-of select="concat( @name, 'Id')"/>
</xsl:when>
<xsl:when test="$abstract-key-name-convention = 'Name_Id'">
<xsl:value-of select="concat( @name, '_Id')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'Id'"/>
</xsl:otherwise>
<xsl:otherwise>[none]</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@ -193,9 +184,10 @@
${ScriptsHelper.InstallScript( "Sitewide")}
${ScriptsHelper.InstallScript( "Behaviour")}
${ScriptsHelper.InstallScript( "Epoch")}
${ScriptsHelper.InstallScript( "Panes")}
<script type='text/javascript' language='JavaScript1.2'>
var panes = new Array( <xsl:for-each select='fieldgroup'>
var panes = new Array( <xsl:for-each select='adl:fieldgroup'>
"<xsl:value-of select='@name'/>"<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>,</xsl:otherwise>
@ -250,7 +242,7 @@
<script type="text/javascript" language='JavaScript1.2' src="../script/panes.js"></script>
<style type="text/css">
<xsl:for-each select="../adl:property[@required='true']">
<xsl:for-each select="ancestor::adl:entity//adl:property[@required='true']">
#<xsl:value-of select="concat( 'advice-required-instance_', @name)"/>
{
color: white;
@ -320,20 +312,7 @@
<!-- there isn't a natural primary key; create a hidden widget
for the abstract primary key -->
<xsl:variable name="keyfield">
<xsl:choose>
<xsl:when test="$abstract-key-name-convention='Name'">
<xsl:value-of select="ancestor::adl:entity/@name"/>
</xsl:when>
<xsl:when test="$abstract-key-name-convention = 'NameId'">
<xsl:value-of select="concat( ancestor::adl:entity/@name, 'Id')"/>
</xsl:when>
<xsl:when test="$abstract-key-name-convention = 'Name_Id'">
<xsl:value-of select="concat( ancestor::adl:entity/@name, '_Id')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'Id'"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="ancestor::adl:entity/adl:key/adl:property[position()=1]/@name"/>
</xsl:variable>
${FormHelper.HiddenField( "instance.<xsl:value-of select="$keyfield"/>")}
</xsl:otherwise>
@ -432,31 +411,39 @@
<xsl:template match="adl:auxlist">
<xsl:variable name="listprop" select="@property"/>
<xsl:variable name="farent" select="ancestor::entity/property[@name=$listprop]/@entity"/>
<xsl:variable name="nearent" select="ancestor::entity/@name"/>
<xsl:variable name="farent" select="ancestor::adl:entity//adl:property[@name=$listprop]/@entity"/>
<xsl:variable name="nearent" select="ancestor::adl:entity/@name"/>
<xsl:variable name="farid">
<xsl:choose>
<xsl:when test="//adl:entity[@name=$farent]/@natural-key">
<xsl:value-of select="//adl:entity[@name=$farent]/@natural-key"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat( $farent, 'Id')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="//adl:entity[@name=$farent]/adl:key//adl:property[position()=1]/@name"/>
</xsl:variable>
<xsl:variable name="farkey">
<xsl:value-of select="//adl:entity[@name=$farent]/adl:property[@entity=$nearent]/@name"/>
<xsl:choose>
<xsl:when test="//adl:entity[@name=$farent]//adl:property[@entity=$nearent]/@farkey">
<xsl:value-of select="//adl:entity[@name=$farent]//adl:property[@entity=$nearent]/@farkey"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//adl:entity[@name=$farent]//adl:property[@entity=$nearent]/@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nearkey">
<xsl:choose>
<xsl:when test="ancestor::adl:entity[@natural-key]">
<xsl:value-of select="ancestor::adl:entity[@natural-key]"/>
<xsl:when test="ancestor::adl:entity/adl:key/adl:property[position()=1 and @type='entity']">
<xsl:value-of select="concat( ancestor::adl:entity/adl:key/adl:property[position()=1]/@name, '_Value')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat( $nearent, 'Id')"/>
<xsl:value-of select="ancestor::adl:entity/adl:key/adl:property[position()=1]/@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:comment>
$listprop = <xsl:value-of select="$listprop"/>;
$farent = <xsl:value-of select="$farent"/>;
$nearent = <xsl:value-of select="$nearent"/>;
$farid = <xsl:value-of select="$farid"/>;
$farkey = <xsl:value-of select="$farkey"/>;
$nearkey = <xsl:value-of select="$nearkey"/>;
</xsl:comment>
<xsl:variable name="action" select="concat( '../', $farent, '/', @onselect)"/>
<xsl:if test="@canadd='true'">
<tr>
@ -482,7 +469,7 @@
<!-- Getting the prompt for the field from a property of another entity is a bit
complex... -->
<xsl:call-template name="showprompt">
<xsl:with-param name="node" select="//adl:entity[@name=$farent]/adl:property[@name=$fieldprop]"/>
<xsl:with-param name="node" select="//adl:entity[@name=$farent]//adl:property[@name=$fieldprop]"/>
<xsl:with-param name="fallback" select="@property"/>
</xsl:call-template>
</th>
@ -502,15 +489,15 @@
<xsl:variable name="fieldprop" select="@property"/>
<td>
<xsl:choose>
<xsl:when test="//adl:entity[@name=$farent]/adl:property[@name=$fieldprop]/@type='entity'">
<xsl:when test="//adl:entity[@name=$farent]//adl:property[@name=$fieldprop]/@type='entity'">
#if ( $item.<xsl:value-of select="@property"/>)
$item.<xsl:value-of select="@property"/>.UserIdentifier
#end
</xsl:when>
<xsl:when test="//adl:entity[@name=$farent]/adl:property[@name=$fieldprop]/adl:option">
<xsl:when test="//adl:entity[@name=$farent]//adl:property[@name=$fieldprop]/adl:option">
<!-- if we can get a prompt value for the option, it would be better to
show it than the raw value-->
<xsl:for-each select="//adl:entity[@name=$farent]/adl:property[@name=$fieldprop]/adl:option">
<xsl:for-each select="//adl:entity[@name=$farent]//adl:property[@name=$fieldprop]/adl:option">
#if ( $item.<xsl:value-of select="$fieldprop"/> == '<xsl:value-of select="@value"/>')
<xsl:call-template name="showprompt">
<xsl:with-param name="fallback" select="@value"/>
@ -536,10 +523,9 @@
#end
</xsl:when>
<xsl:otherwise>
<!-- properties not listed, so therefore presumably all. TODO: This won't work, rewrite. Need to
find the entity of the property this auxlist depends on, and then interrogate that -->
<!-- properties not listed, so therefore presumably all. -->
<tr>
<xsl:for-each select="ancestor::adl:entity/adl:property[@distinct='user']">
<xsl:for-each select="//adl:entity[@name=$farent]//adl:property[@distinct='user']">
<th>
<xsl:choose>
<xsl:when test="adl:prompt[@locale=$locale]">
@ -553,22 +539,43 @@
</xsl:for-each>
<th>-</th>
</tr>
#foreach( $instance in $instances)
#foreach( $item in $instance.<xsl:value-of select="@property"/>)
#if ( $velocityCount % 2 == 0)
#set( $oddity = "even")
#else
#set( $oddity = "odd")
#end
<tr class="$oddity">
<xsl:for-each select="ancestor::adl:entity/adl:property[@distinct='user']">
<xsl:for-each select="//adl:entity[@name=$farent]//adl:property[@distinct='user']">
<td>
$!instance.<xsl:value-of select="@name"/>
<xsl:variable name="fieldprop" select="@name"/>
<xsl:choose>
<xsl:when test="@type='entity'">
#if ( $item.<xsl:value-of select="@name"/>)
$item.<xsl:value-of select="@name"/>.UserIdentifier
#end
</xsl:when>
<xsl:when test="adl:option">
<!-- if we can get a prompt value for the option, it would be better to
show it than the raw value-->
<xsl:for-each select="adl:option">
#if ( $item.<xsl:value-of select="$fieldprop"/> == '<xsl:value-of select="@value"/>')
<xsl:call-template name="showprompt">
<xsl:with-param name="fallback" select="@value"/>
</xsl:call-template>
#end
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
$!item.<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:for-each>
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat( $action, '.rails?', ../@name, 'Id=$instance.', ../@name, 'Id')"/>
<xsl:value-of select="concat( $action, '.rails?', $farid, '=$item.', $farid)"/>
</xsl:attribute>
Edit!
</a>
@ -615,9 +622,9 @@
<xsl:value-of select="@property"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="ancestor::adl:entity/adl:property[@name=$propname]">
<xsl:when test="ancestor::adl:entity//adl:property[@name=$propname]">
<!-- there is a real property -->
<xsl:apply-templates select="ancestor::adl:entity/adl:property[@name=$propname]">
<xsl:apply-templates select="ancestor::adl:entity//adl:property[@name=$propname]">
<xsl:with-param name="oddness">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
@ -628,7 +635,7 @@
</xsl:when>
<xsl:otherwise>
<!-- it's presumably intended to be a computed field -->
Computed field (<xsl:value-of select="@name"/>)? TODO: Not yet implememented
<xsl:comment>Computed field (<xsl:value-of select="$propname"/>)? TODO: Not yet implememented</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@ -792,14 +799,15 @@
<xsl:variable name="permission">
<xsl:choose>
<xsl:when test="adl:permission">
<xsl:value-of select="adl:permission[position()=1]/@permission"/>
<xsl:value-of select="adl:permission[@group=$permissions-group]/@permission"/>
</xsl:when>
<xsl:when test="../adl:permission">
<xsl:value-of select="../adl:permission[position()=1]/@permission"/>
<xsl:when test="ancestor::adl:entity/adl:permission">
<xsl:value-of select="ancestor::adl:entity/adl:permission[@group=$permissions-group]/@permission"/>
</xsl:when>
<xsl:otherwise>none</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$permission != 'none'">
<tr>
<xsl:attribute name="class">
<xsl:value-of select="$oddness"/>
@ -831,6 +839,7 @@
is no current value, else a 'not authorised' message -->
<!-- TODO: if $permission='noedit', then you should get an editable widget if there
is no current value, else just the value -->
<!-- TODO: if required='true', then you should not get the firstoption stuff -->
<xsl:when test="@type='entity'">
<!-- a menu of the appropriate entity -->
#if ( $instance)
@ -935,7 +944,7 @@
</xsl:if>
<!-- TODO: generate javascript to do client-side validation -->
</xsl:when>
<xsl:when test="option">
<xsl:when test="adl:option">
<!-- if a property has options, we definitely want a select widget-->
<select>
<xsl:attribute name="id">
@ -947,7 +956,7 @@
<xsl:attribute name="title">
<xsl:value-of select="normalize-space( $if-missing)"/>
</xsl:attribute>
<xsl:apply-templates select="option"/>
<xsl:apply-templates select="adl:option"/>
</select>
<script type="text/javascript" language="javascript">
// &lt;![CDATA[
@ -995,6 +1004,7 @@
<xsl:apply-templates select="adl:help[@locale = $locale]"/>
</td>
</tr>
</xsl:if>
</xsl:template>
<xsl:template match="adl:prompt">
@ -1122,7 +1132,7 @@
<xsl:for-each select="adl:field">
<th>
<xsl:variable name="pname" select="@property"/>
<xsl:variable name="property" select="ancestor::adl:entity/adl:property[@name=$pname]"/>
<xsl:variable name="property" select="ancestor::adl:entity//adl:property[@name=$pname]"/>
<xsl:choose>
<xsl:when test="$property/adl:prompt[@locale=$locale]">
<xsl:value-of select="$property/adl:prompt[@locale=$locale]/@prompt"/>
@ -1148,15 +1158,15 @@
<td>
<xsl:variable name="prop" select="@property"/>
<xsl:choose>
<xsl:when test="ancestor::adl:entity/adl:property[@name=$prop]/@type = 'date'">
<xsl:when test="ancestor::adl:entity//adl:property[@name=$prop]/@type = 'date'">
#if ( $instance.<xsl:value-of select="@property"/>)
$instance.<xsl:value-of select="@property"/>.ToString( 'd')
#end
</xsl:when>
<xsl:when test="ancestor::adl:entity/adl:property[@name=$prop]/@type='message'">
<xsl:when test="ancestor::adl:entity//adl:property[@name=$prop]/@type='message'">
$t.Msg( $instance.<xsl:value-of select="$prop"/>)
</xsl:when>
<xsl:when test="ancestor::adl:entity/adl:property[@name=$prop]/@type='entity'">
<xsl:when test="ancestor::adl:entity//adl:property[@name=$prop]/@type='entity'">
#if( $instance.<xsl:value-of select="$prop"/>)
$instance.<xsl:value-of select="$prop"/>.UserIdentifier
#end
@ -1177,7 +1187,14 @@
<xsl:otherwise>&amp;</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="@type='entity'">
<xsl:value-of select="concat( $sep, @name, '_Value=$instance.', @name, '_Value')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat( $sep, @name, '=$instance.', @name)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<xsl:for-each select="ancestor::adl:entity/adl:form">
@ -1198,7 +1215,7 @@
<xsl:otherwise>
<!-- properties are not 'listed' -->
<tr>
<xsl:for-each select="ancestor::adl:entity/adl:property[@distinct='user']">
<xsl:for-each select="ancestor::adl:entity//adl:property[@distinct='user' and not( @type='link' or @type='list')]">
<th>
<xsl:choose>
<xsl:when test="adl:prompt[@locale=$locale]">
@ -1221,7 +1238,7 @@
#set( $oddity = "odd")
#end
<tr class="$oddity">
<xsl:for-each select="ancestor::adl:entity/adl:property[@distinct='user']">
<xsl:for-each select="ancestor::adl:entity//adl:property[@distinct='user']">
<td>
<xsl:choose>
<xsl:when test="@type='entity'">
@ -1245,7 +1262,14 @@
<xsl:otherwise>&amp;</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="@type='entity'">
<xsl:value-of select="concat( $sep, @name, '_Value=$instance.', @name, '_Value')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat( $sep, @name, '=$instance.', @name)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<xsl:for-each select="ancestor::adl:entity/adl:form">