1.1 --- a/examples/Common/VerySimple/Resources/structure_comments.xsl Thu Jul 21 23:53:29 2005 +0000
1.2 +++ b/examples/Common/VerySimple/Resources/structure_comments.xsl Thu Jul 21 23:54:31 2005 +0000
1.3 @@ -10,23 +10,25 @@
1.4 <!-- Copy the element and its contents. -->
1.5 <xsl:copy>
1.6 <xsl:apply-templates select="@*"/>
1.7 - <!-- Only for certain element types... -->
1.8 - <xsl:if test="type/type-enum[@value='Personal' and @value-is-set]">
1.9 - <!-- Ensure a comment element. -->
1.10 - <xsl:call-template name="comment"/>
1.11 - </xsl:if>
1.12 - <xsl:apply-templates select="*[local-name() != 'comment']"/>
1.13 + <!-- Ensure an options element. -->
1.14 + <xsl:call-template name="options"/>
1.15 + <xsl:apply-templates select="*[local-name() != 'options']"/>
1.16 </xsl:copy>
1.17 </xsl:template>
1.18
1.19 - <!-- Investigate comment elements. -->
1.20 + <!-- Investigate options elements. -->
1.21
1.22 - <xsl:template name="comment">
1.23 + <xsl:template name="options">
1.24 <!-- Make the element. -->
1.25 - <comment>
1.26 - <!-- Look for comment text. -->
1.27 - <xsl:apply-templates select="comment/@*"/>
1.28 - </comment>
1.29 + <options>
1.30 + <!-- Only for certain element types... -->
1.31 + <xsl:if test="type/type-enum[@value='Personal' and @value-is-set]">
1.32 + <!-- Add comments. -->
1.33 + <comment>
1.34 + <xsl:apply-templates select="options/comment/@value"/>
1.35 + </comment>
1.36 + </xsl:if>
1.37 + </options>
1.38 </xsl:template>
1.39
1.40 <!-- Replicate unknown elements. -->
2.1 --- a/examples/Common/VerySimple/Resources/structure_multivalue_template.xhtml Thu Jul 21 23:53:29 2005 +0000
2.2 +++ b/examples/Common/VerySimple/Resources/structure_multivalue_template.xhtml Thu Jul 21 23:54:31 2005 +0000
2.3 @@ -5,6 +5,8 @@
2.4 xmlns:template="http://www.boddie.org.uk/ns/xmltools/template">
2.5 <head>
2.6 <title>Example</title>
2.7 + <script type="text/javascript" src="scripts/sarissa.js"> </script>
2.8 + <script type="text/javascript" src="scripts/XSLForms.js"> </script>
2.9 </head>
2.10 <body template:element="structure">
2.11 <form action="" method="POST">
2.12 @@ -18,16 +20,20 @@
2.13 </p>
2.14 <p>
2.15 Item type:
2.16 - <select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple">
2.17 + <select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple"
2.18 + onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}',
2.19 + '{template:other-elements(../options)}', '{template:other-attributes('value', ../options/comment)}',
2.20 + '/structure/item/options')">
2.21 <option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected"
2.22 template:value="@value" value="{@value}" />
2.23 </select>
2.24 </p>
2.25 - <p template:element="comment" template:id="comment-node" id="{template:this-element()}">
2.26 - Comment:
2.27 - <textarea template:attribute="value" name="{template:this-attribute()}" cols="40" rows="3">
2.28 - <span template:value="$this-value" template:effect="replace">Some comment</span>
2.29 - </textarea>
2.30 + <p template:element="options" template:id="comment-node" id="{template:this-element()}">
2.31 + <span template:element="comment">Comment:
2.32 + <textarea template:attribute="value" name="{template:this-attribute()}" cols="40" rows="3">
2.33 + <span template:value="$this-value" template:effect="replace">Some comment</span>
2.34 + </textarea>
2.35 + </span>
2.36 </p>
2.37 <p>
2.38 Itself containing more items: