1.1 --- a/XSLForms/XSL/Input.xsl Sat Jun 21 01:38:50 2008 +0200
1.2 +++ b/XSLForms/XSL/Input.xsl Sun Dec 11 21:45:19 2005 +0000
1.3 @@ -233,21 +233,31 @@
1.4 </xsl:if>
1.5
1.6 <!-- Select inside the enumeration source, inside an element with the field's name, the enumeration elements. -->
1.7 - <!-- NOTE: We could avoid dyn:evaluate if we were certain that a document reference was being used. -->
1.8 - <!-- NOTE: However, we may want to be able to refer to other places within the document, and this requires -->
1.9 - <!-- NOTE: some dynamic evaluation. -->
1.10 - <axsl:for-each select="dyn:evaluate(${../@name})/{../@name}/{@name}">
1.11 - <axsl:copy>
1.12 - <axsl:apply-templates select="@*"/>
1.13 - <xsl:if test="@type='multiple-choice-list-value'">
1.14 - <axsl:if test="$values-{@name}[string() = current()/@{attribute/@name}]">
1.15 - <axsl:attribute name="{@expr-name}">true</axsl:attribute>
1.16 - </axsl:if>
1.17 - </xsl:if>
1.18 - <!-- Include child nodes, if provided. -->
1.19 - <axsl:copy-of select="node()"/>
1.20 - </axsl:copy>
1.21 - </axsl:for-each>
1.22 + <xsl:choose>
1.23 + <xsl:when test="../@source='dynamic'">
1.24 + <axsl:for-each select="dyn:evaluate(${../@name})/{../@name}/{@name}">
1.25 + <xsl:call-template name="inside-enumeration-element"/>
1.26 + </axsl:for-each>
1.27 + </xsl:when>
1.28 + <xsl:otherwise>
1.29 + <axsl:for-each select="${../@name}/{../@name}/{@name}">
1.30 + <xsl:call-template name="inside-enumeration-element"/>
1.31 + </axsl:for-each>
1.32 + </xsl:otherwise>
1.33 + </xsl:choose>
1.34 + </xsl:template>
1.35 +
1.36 + <xsl:template name="inside-enumeration-element">
1.37 + <axsl:copy>
1.38 + <axsl:apply-templates select="@*"/>
1.39 + <xsl:if test="@type='multiple-choice-list-value'">
1.40 + <axsl:if test="$values-{@name}[string() = current()/@{attribute/@name}]">
1.41 + <axsl:attribute name="{@expr-name}">true</axsl:attribute>
1.42 + </axsl:if>
1.43 + </xsl:if>
1.44 + <!-- Include child nodes, if provided. -->
1.45 + <axsl:copy-of select="node()"/>
1.46 + </axsl:copy>
1.47 </xsl:template>
1.48
1.49 </xsl:stylesheet>