1.1 --- a/XSLForms/XSL/Schema.xsl Mon Oct 03 00:54:19 2005 +0000
1.2 +++ b/XSLForms/XSL/Schema.xsl Mon Oct 03 15:48:32 2005 +0000
1.3 @@ -108,28 +108,50 @@
1.4 </selector>
1.5 </xsl:when>
1.6 <xsl:when test="@template:multiple-choice-field">
1.7 - <element type="multiple-choice">
1.8 - <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-field, ',')"/>
1.9 - <xsl:variable name="field-attr" select="substring-after(@template:multiple-choice-field, ',')"/>
1.10 - <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.11 - <attribute>
1.12 - <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.13 - </attribute>
1.14 - <xsl:apply-templates select="*"/>
1.15 - </element>
1.16 + <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-field, ',')"/>
1.17 + <xsl:variable name="field-attr" select="substring-after(@template:multiple-choice-field, ',')"/>
1.18 + <xsl:choose>
1.19 + <xsl:when test="$field-element != '-'">
1.20 + <element type="multiple-choice">
1.21 + <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.22 + <attribute>
1.23 + <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.24 + </attribute>
1.25 + <xsl:apply-templates select="*"/>
1.26 + </element>
1.27 + </xsl:when>
1.28 + <xsl:otherwise>
1.29 + <xsl:attribute name="type">multiple-choice</xsl:attribute>
1.30 + <attribute>
1.31 + <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.32 + </attribute>
1.33 + <xsl:apply-templates select="*"/>
1.34 + </xsl:otherwise>
1.35 + </xsl:choose>
1.36 </xsl:when>
1.37 <xsl:when test="@template:multiple-choice-list-field">
1.38 - <element type="multiple-choice-list">
1.39 - <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-list-field, ',')"/>
1.40 - <xsl:variable name="field-list-info" select="substring-after(@template:multiple-choice-list-field, ',')"/>
1.41 - <xsl:variable name="field-list-element" select="substring-before($field-list-info, ',')"/>
1.42 - <xsl:variable name="field-list-attr" select="substring-after($field-list-info, ',')"/>
1.43 - <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.44 - <attribute>
1.45 - <xsl:attribute name="name"><xsl:value-of select="$field-list-attr"/></xsl:attribute>
1.46 - </attribute>
1.47 - <xsl:apply-templates select="*"/>
1.48 - </element>
1.49 + <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-list-field, ',')"/>
1.50 + <xsl:variable name="field-list-info" select="substring-after(@template:multiple-choice-list-field, ',')"/>
1.51 + <xsl:variable name="field-list-element" select="substring-before($field-list-info, ',')"/>
1.52 + <xsl:variable name="field-list-attr" select="substring-after($field-list-info, ',')"/>
1.53 + <xsl:choose>
1.54 + <xsl:when test="$field-element != '-'">
1.55 + <element type="multiple-choice-list">
1.56 + <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.57 + <attribute>
1.58 + <xsl:attribute name="name"><xsl:value-of select="$field-list-attr"/></xsl:attribute>
1.59 + </attribute>
1.60 + <xsl:apply-templates select="*"/>
1.61 + </element>
1.62 + </xsl:when>
1.63 + <xsl:otherwise>
1.64 + <xsl:attribute name="type">multiple-choice-list</xsl:attribute>
1.65 + <attribute>
1.66 + <xsl:attribute name="name"><xsl:value-of select="$field-list-attr"/></xsl:attribute>
1.67 + </attribute>
1.68 + <xsl:apply-templates select="*"/>
1.69 + </xsl:otherwise>
1.70 + </xsl:choose>
1.71 </xsl:when>
1.72 <xsl:when test="@template:multiple-choice-value">
1.73 <element type="multiple-choice-value">