1.1 --- a/XSLForms/XSL/Schema.xsl Mon Oct 03 00:49:15 2005 +0000
1.2 +++ b/XSLForms/XSL/Schema.xsl Mon Oct 03 00:52:17 2005 +0000
1.3 @@ -10,10 +10,8 @@
1.4 <!-- Match the document itself. -->
1.5
1.6 <xsl:template match="/">
1.7 -
1.8 <!-- Process the elements. -->
1.9 <xsl:apply-templates select="*"/>
1.10 -
1.11 </xsl:template>
1.12
1.13
1.14 @@ -50,9 +48,6 @@
1.15 <xsl:param name="remaining-elements"/>
1.16 <element>
1.17 <xsl:attribute name="name"><xsl:value-of select="$first-element"/></xsl:attribute>
1.18 - <xsl:if test="@template:expr">
1.19 - <xsl:attribute name="expr"><xsl:value-of select="@template:expr"/></xsl:attribute>
1.20 - </xsl:if>
1.21 <xsl:choose>
1.22 <xsl:when test="$remaining-elements = ''">
1.23 <xsl:call-template name="enter-attribute"/>
1.24 @@ -70,7 +65,7 @@
1.25
1.26 <!-- Match attributes. -->
1.27
1.28 - <xsl:template match="*[not(@template:element) and (@template:attribute or @template:expr-attr)]">
1.29 + <xsl:template match="*[not(@template:element) and (@template:attribute or @template:attribute-field or @template:attribute-area or @template:attribute-button or @template:selector-field or @template:multiple-choice-field or @template:multiple-choice-list-field or @template:multiple-choice-value or @template:multiple-choice-list-value)]">
1.30 <xsl:call-template name="enter-attribute"/>
1.31 </xsl:template>
1.32
1.33 @@ -81,16 +76,92 @@
1.34 <xsl:attribute name="name"><xsl:value-of select="@template:attribute"/></xsl:attribute>
1.35 </attribute>
1.36 </xsl:when>
1.37 + <xsl:when test="@template:attribute-field">
1.38 + <attribute>
1.39 + <xsl:attribute name="name"><xsl:value-of select="@template:attribute-field"/></xsl:attribute>
1.40 + </attribute>
1.41 + </xsl:when>
1.42 + <xsl:when test="@template:attribute-area">
1.43 + <attribute>
1.44 + <xsl:attribute name="name"><xsl:value-of select="@template:attribute-area"/></xsl:attribute>
1.45 + </attribute>
1.46 + </xsl:when>
1.47 + <xsl:when test="@template:attribute-button">
1.48 + <attribute>
1.49 + <xsl:variable name="field-attr" select="substring-before(@template:attribute-button, ',')"/>
1.50 + <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.51 + </attribute>
1.52 + </xsl:when>
1.53 + <xsl:when test="@template:selector-field">
1.54 + <xsl:variable name="field-name" select="substring-before(@template:selector-field, ',')"/>
1.55 + <xsl:variable name="affected-element" select="substring-after(@template:selector-field, ',')"/>
1.56 + <selector>
1.57 + <xsl:choose>
1.58 + <xsl:when test="$field-name != ''">
1.59 + <xsl:attribute name="name"><xsl:value-of select="$field-name"/></xsl:attribute>
1.60 + <xsl:attribute name="element"><xsl:value-of select="$affected-element"/></xsl:attribute>
1.61 + </xsl:when>
1.62 + <xsl:otherwise>
1.63 + <xsl:attribute name="name"><xsl:value-of select="@template:selector-field"/></xsl:attribute>
1.64 + </xsl:otherwise>
1.65 + </xsl:choose>
1.66 + </selector>
1.67 + </xsl:when>
1.68 + <xsl:when test="@template:multiple-choice-field">
1.69 + <element type="multiple-choice">
1.70 + <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-field, ',')"/>
1.71 + <xsl:variable name="field-attr" select="substring-after(@template:multiple-choice-field, ',')"/>
1.72 + <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.73 + <attribute>
1.74 + <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.75 + </attribute>
1.76 + <xsl:apply-templates select="*"/>
1.77 + </element>
1.78 + </xsl:when>
1.79 + <xsl:when test="@template:multiple-choice-list-field">
1.80 + <element type="multiple-choice-list">
1.81 + <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-list-field, ',')"/>
1.82 + <xsl:variable name="field-list-info" select="substring-after(@template:multiple-choice-list-field, ',')"/>
1.83 + <xsl:variable name="field-list-element" select="substring-before($field-list-info, ',')"/>
1.84 + <xsl:variable name="field-list-attr" select="substring-after($field-list-info, ',')"/>
1.85 + <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.86 + <attribute>
1.87 + <xsl:attribute name="name"><xsl:value-of select="$field-list-attr"/></xsl:attribute>
1.88 + </attribute>
1.89 + <xsl:apply-templates select="*"/>
1.90 + </element>
1.91 + </xsl:when>
1.92 + <xsl:when test="@template:multiple-choice-value">
1.93 + <element type="multiple-choice-value">
1.94 + <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-value, ',')"/>
1.95 + <xsl:variable name="field-attr-info" select="substring-after(@template:multiple-choice-value, ',')"/>
1.96 + <xsl:variable name="field-attr" select="substring-before($field-attr-info, ',')"/>
1.97 + <xsl:variable name="field-set-attr" select="substring-after($field-attr-info, ',')"/>
1.98 + <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.99 + <xsl:attribute name="expr">@<xsl:value-of select="$field-attr"/> = ../@<xsl:value-of select="$field-attr"/></xsl:attribute>
1.100 + <xsl:attribute name="expr-attr"><xsl:value-of select="$field-set-attr"/></xsl:attribute>
1.101 + <attribute>
1.102 + <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.103 + </attribute>
1.104 + </element>
1.105 + </xsl:when>
1.106 + <xsl:when test="@template:multiple-choice-list-value">
1.107 + <element type="multiple-choice-list-value">
1.108 + <xsl:variable name="field-element" select="substring-before(@template:multiple-choice-list-value, ',')"/>
1.109 + <xsl:variable name="field-attr-info" select="substring-after(@template:multiple-choice-list-value, ',')"/>
1.110 + <xsl:variable name="field-attr" select="substring-before($field-attr-info, ',')"/>
1.111 + <xsl:variable name="field-set-attr" select="substring-after($field-attr-info, ',')"/>
1.112 + <xsl:attribute name="name"><xsl:value-of select="$field-element"/></xsl:attribute>
1.113 + <xsl:attribute name="expr">@value-is-set</xsl:attribute>
1.114 + <!-- Special attribute corresponding with the expression. -->
1.115 + <xsl:attribute name="expr-name">value-is-set</xsl:attribute>
1.116 + <xsl:attribute name="expr-attr"><xsl:value-of select="$field-set-attr"/></xsl:attribute>
1.117 + <attribute>
1.118 + <xsl:attribute name="name"><xsl:value-of select="$field-attr"/></xsl:attribute>
1.119 + </attribute>
1.120 + </element>
1.121 + </xsl:when>
1.122 <xsl:otherwise>
1.123 - <xsl:if test="@template:expr-attr">
1.124 - <xsl:attribute name="expr-attr"><xsl:value-of select="@template:expr-attr"/></xsl:attribute>
1.125 - </xsl:if>
1.126 - <xsl:if test="@template:expr">
1.127 - <xsl:attribute name="expr"><xsl:value-of select="@template:expr"/></xsl:attribute>
1.128 - </xsl:if>
1.129 - <xsl:if test="@template:value">
1.130 - <xsl:attribute name="value"><xsl:value-of select="@template:value"/></xsl:attribute>
1.131 - </xsl:if>
1.132 <xsl:apply-templates select="*"/>
1.133 </xsl:otherwise>
1.134 </xsl:choose>