1.1 --- a/XSLForms/XSL/Input.xsl Mon Oct 03 15:48:32 2005 +0000
1.2 +++ b/XSLForms/XSL/Input.xsl Mon Oct 03 19:09:50 2005 +0000
1.3 @@ -75,18 +75,15 @@
1.4 <xsl:template name="process-element">
1.5 <xsl:param name="path" select="@name"/>
1.6
1.7 - <!-- Store multiple-choice selections, if appropriate. -->
1.8 - <xsl:if test="@type='multiple-choice-list'">
1.9 - <axsl:variable name="values" select="{@name}/{element[@type='multiple-choice-list-value']/@name}/@{attribute/@name}"/>
1.10 - </xsl:if>
1.11 -
1.12 <!-- Define elements which do not have selectors. -->
1.13 <xsl:variable name="adding-selectors" select="count(//selector[@element=current()/@name])"/>
1.14
1.15 <xsl:choose>
1.16 <!-- Enumerations. -->
1.17 <xsl:when test="@type='multiple-choice-value' or @type='multiple-choice-list-value'">
1.18 - <xsl:call-template name="inside-enumeration"/>
1.19 + <xsl:call-template name="inside-enumeration">
1.20 + <xsl:with-param name="path" select="$path"/>
1.21 + </xsl:call-template>
1.22 </xsl:when>
1.23 <!-- Added elements. -->
1.24 <xsl:when test="$adding-selectors = 0">
1.25 @@ -111,6 +108,7 @@
1.26 <!-- Process rules. -->
1.27
1.28 <xsl:template name="process-rules">
1.29 + <xsl:param name="path" select="@name"/>
1.30
1.31 <!-- Define elements which do not have selectors. -->
1.32 <!-- NOTE: Duplicating adding-selectors - see above. -->
1.33 @@ -122,7 +120,9 @@
1.34 </xsl:when>
1.35 <xsl:when test="$adding-selectors = 0">
1.36 <xsl:for-each select="element">
1.37 - <xsl:call-template name="process-rules"/>
1.38 + <xsl:call-template name="process-rules">
1.39 + <xsl:with-param name="path" select="concat($path, '/', @name)"/>
1.40 + </xsl:call-template>
1.41 </xsl:for-each>
1.42 </xsl:when>
1.43 <xsl:otherwise>
1.44 @@ -136,11 +136,18 @@
1.45 <!-- Fill in enumerations. -->
1.46
1.47 <xsl:template name="inside-enumeration">
1.48 + <xsl:param name="path" select="@name"/>
1.49 +
1.50 + <!-- Store multiple-choice selections, if appropriate. -->
1.51 + <xsl:if test="../@type='multiple-choice-list'">
1.52 + <axsl:variable name="values-{@name}" select="{$path}/@{../attribute/@name}"/>
1.53 + </xsl:if>
1.54 +
1.55 <axsl:for-each select="${../@name}/{../@name}/{@name}">
1.56 <axsl:copy>
1.57 <axsl:apply-templates select="@*"/>
1.58 <xsl:if test="@type='multiple-choice-list-value'">
1.59 - <axsl:if test="$values[string() = current()/@{attribute/@name}]">
1.60 + <axsl:if test="$values-{@name}[string() = current()/@{attribute/@name}]">
1.61 <axsl:attribute name="{@expr-name}">1</axsl:attribute>
1.62 </axsl:if>
1.63 </xsl:if>