1.1 --- a/XSLForms/Output.py Tue Jul 19 23:40:05 2005 +0000
1.2 +++ b/XSLForms/Output.py Wed Jul 20 12:53:04 2005 +0000
1.3 @@ -150,6 +150,17 @@
1.4 r = ",".join(names)
1.5 return r.encode("utf-8")
1.6
1.7 +# New names.
1.8 +
1.9 +libxsltmod.xsltRegisterExtModuleFunction("this-element", "http://www.boddie.org.uk/ns/xmltools/template", this_position)
1.10 +libxsltmod.xsltRegisterExtModuleFunction("this-attribute", "http://www.boddie.org.uk/ns/xmltools/template", field_name)
1.11 +libxsltmod.xsltRegisterExtModuleFunction("list-attribute", "http://www.boddie.org.uk/ns/xmltools/template", multi_field_name)
1.12 +libxsltmod.xsltRegisterExtModuleFunction("new-attribute", "http://www.boddie.org.uk/ns/xmltools/template", new_field)
1.13 +libxsltmod.xsltRegisterExtModuleFunction("other-nodes", "http://www.boddie.org.uk/ns/xmltools/template", other_field_names)
1.14 +libxsltmod.xsltRegisterExtModuleFunction("other-list-attributes", "http://www.boddie.org.uk/ns/xmltools/template", other_multi_field_names)
1.15 +
1.16 +# Old names.
1.17 +
1.18 libxsltmod.xsltRegisterExtModuleFunction("this-position", "http://www.boddie.org.uk/ns/xmltools/template", this_position)
1.19 libxsltmod.xsltRegisterExtModuleFunction("field-name", "http://www.boddie.org.uk/ns/xmltools/template", field_name)
1.20 libxsltmod.xsltRegisterExtModuleFunction("multi-field-name", "http://www.boddie.org.uk/ns/xmltools/template", multi_field_name)
2.1 --- a/docs/multiple.html Tue Jul 19 23:40:05 2005 +0000
2.2 +++ b/docs/multiple.html Wed Jul 20 12:53:04 2005 +0000
2.3 @@ -40,14 +40,14 @@
2.4 <p>Taking the example HTML code from before, we can add a
2.5 definition of this new list to the template to produce something
2.6 like this:</p>
2.7 -<pre><html xmlns="http://www.w3.org/1999/xhtml"<br /> xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"><br /><head><br /> <title>Example</title><br /></head><br /><body template:element="structure"><br /><form action="" method="POST"><br /><br /><!-- Template text between the start and the interesting part. --><br /><br /><div template:element="item"><br /> <p><br /> Some item: <input template:attribute="value" name="{template:field-name()}" type="text" value="{$this-value}" /><br /> <input name="remove={template:this-position()}" type="submit" value="Remove" /><br /> </p><br /> <span
2.8 +<pre><html xmlns="http://www.w3.org/1999/xhtml"<br /> xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"><br /><head><br /> <title>Example</title><br /></head><br /><body template:element="structure"><br /><form action="" method="POST"><br /><br /><!-- Template text between the start and the interesting part. --><br /><br /><div template:element="item"><br /> <p><br /> Some item: <input template:attribute="value" name="{template:this-attribute()}" type="text" value="{$this-value}" /><br /> <input name="remove={template:this-element()}" type="submit" value="Remove" /><br /> </p><br /> <span
2.9 style="font-weight: bold;"><p></span><br
2.10 style="font-weight: bold;" /><span style="font-weight: bold;"> Item type:</span><br
2.11 - style="font-weight: bold;" /><span style="font-weight: bold;"> <select template:element="type" name="{template:new-field('value')}"></span><br
2.12 + style="font-weight: bold;" /><span style="font-weight: bold;"> <select template:element="type" name="{template:new-attribute('value')}"></span><br
2.13 style="font-weight: bold;" /><span style="font-weight: bold;"> <option template:element="type-enum" template:expr="@value = ../@value" template:expr-attr="selected"</span><br
2.14 style="font-weight: bold;" /><span style="font-weight: bold;"> template:value="@value" value="{@value}" /></span><br
2.15 style="font-weight: bold;" /><span style="font-weight: bold;"> </select></span><br
2.16 - style="font-weight: bold;" /><span style="font-weight: bold;"> </p></span><br /> <p><br /> Itself containing more items:<br /> </p><br /> <p template:element="subitem"><br /> Sub-item: <input template:attribute="subvalue" name="{template:field-name()}" type="text" value="{$this-value}" /><br /> <input name="remove2={template:this-position()}" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="add2={template:this-position()}" type="submit" value="Add subitem" /><br /> </p><br /></div><br /><p><br /> <input name="add={template:this-position()}" type="submit" value="Add item" /><br /></p><span
2.17 + style="font-weight: bold;" /><span style="font-weight: bold;"> </p></span><br /> <p><br /> Itself containing more items:<br /> </p><br /> <p template:element="subitem"><br /> Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" /><br /> <input name="remove2={template:this-element()}" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="add2={template:this-element()}" type="submit" value="Add subitem" /><br /> </p><br /></div><br /><p><br /> <input name="add={template:this-element()}" type="submit" value="Add item" /><br /></p><span
2.18 style="font-weight: bold;"><br /><br /></span><!-- Template text between the interesting part and the end. --><br /><br /></form><br /></body><br /></html></pre>
2.19 <p>There are a lot of details here that need to be explained. Here is
2.20 what was done:</p>
3.1 --- a/docs/selectors.html Tue Jul 19 23:40:05 2005 +0000
3.2 +++ b/docs/selectors.html Wed Jul 20 12:53:04 2005 +0000
3.3 @@ -29,11 +29,11 @@
3.4 <p>Taking the example HTML code from before, we add some of these
3.5 selector annotations to the template to produce something
3.6 like this:</p>
3.7 -<pre><html xmlns="http://www.w3.org/1999/xhtml"<br /> xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"><br /><head><br /> <title>Example</title><br /></head><br /><body template:element="structure"><br /><form action="" method="POST"><br /><br /><!-- Template text between the start and the interesting part. --><br /><br /><div template:element="item"><br /> <p><br /> Some item: <input template:attribute="value" name="{template:field-name()}" type="text" value="{$this-value}" /><br /> <input name="<span
3.8 - style="font-weight: bold;">remove={template:this-position()}</span>" type="submit" value="Remove" /><br /> </p><br /> <p><br /> Itself containing more items:<br /> </p><br /> <p template:element="subitem"><br /> Sub-item: <input template:attribute="subvalue" name="{template:field-name()}" type="text" value="{$this-value}" /><br /> <input name="<span
3.9 - style="font-weight: bold;">remove2={template:this-position()}</span>" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="<span
3.10 - style="font-weight: bold;">add2={template:this-position()}</span>" type="submit" value="Add subitem" /><br /> </p><br /></div><br /><p><br /> <input name="<span
3.11 - style="font-weight: bold;">add={template:this-position()}</span>" type="submit" value="Add item" /><br /></p><span
3.12 +<pre><html xmlns="http://www.w3.org/1999/xhtml"<br /> xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"><br /><head><br /> <title>Example</title><br /></head><br /><body template:element="structure"><br /><form action="" method="POST"><br /><br /><!-- Template text between the start and the interesting part. --><br /><br /><div template:element="item"><br /> <p><br /> Some item: <input template:attribute="value" name="{template:this-attribute()}" type="text" value="{$this-value}" /><br /> <input name="<span
3.13 + style="font-weight: bold;">remove={template:this-element()}</span>" type="submit" value="Remove" /><br /> </p><br /> <p><br /> Itself containing more items:<br /> </p><br /> <p template:element="subitem"><br /> Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" /><br /> <input name="<span
3.14 + style="font-weight: bold;">remove2={template:this-element()}</span>" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="<span
3.15 + style="font-weight: bold;">add2={template:this-element()}</span>" type="submit" value="Add subitem" /><br /> </p><br /></div><br /><p><br /> <input name="<span
3.16 + style="font-weight: bold;">add={template:this-element()}</span>" type="submit" value="Add item" /><br /></p><span
3.17 style="font-weight: bold;" /><br /><br /><!-- Template text between the interesting part and the end. --><br /><br /></form><br /></body><br /></html></pre>
3.18 <h3>The Remove Buttons</h3>
3.19 <p>Some of the attributes in the previous HTML code have been
4.1 --- a/docs/structure.html Tue Jul 19 23:40:05 2005 +0000
4.2 +++ b/docs/structure.html Wed Jul 20 12:53:04 2005 +0000
4.3 @@ -39,11 +39,11 @@
4.4 style="font-weight: bold;">template:element="structure"</span>><br /><br /> <item <div <span
4.5 style="font-weight: bold;">template:element="item"</span>><br /> <p><br /> value="some value"> Some item: <input <span
4.6 style="font-weight: bold;">template:attribute="value"</span> name="<span
4.7 - style="font-weight: bold;">{template:field-name()}</span>" type="text" value="<span
4.8 + style="font-weight: bold;">{template:this-attribute()}</span>" type="text" value="<span
4.9 style="font-weight: bold;">{$this-value}</span>" /><br /> <input name="remove" type="submit" value="Remove" /><br /> </p><br /> <p><br /> Itself containing more items:<br /> </p><br /> <subitem <p <span
4.10 style="font-weight: bold;">template:element="subitem"</span>><br /> subvalue="some other value"/> Sub-item: <input <span
4.11 style="font-weight: bold;">template:attribute="subvalue"</span> name="<span
4.12 - style="font-weight: bold;">{template:field-name()}</span>" type="text" value="<span
4.13 + style="font-weight: bold;">{template:this-attribute()}</span>" type="text" value="<span
4.14 style="font-weight: bold;">{$this-value}</span>" /><br /> <input name="remove2" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="add2" type="submit" value="Add subitem" /><br /> </p><br /> </item> </div><br /> <p><br /> <input name="add" type="submit" value="Add item" /><br /> </p><br /><br /></structure> </body></pre>
4.15 <p style="">
4.16 The following annotations have been added:</p>
4.17 @@ -59,7 +59,7 @@
4.18 been changed:</p>
4.19 <ul>
4.20 <li>The <code>input</code> elements' <code>name</code>
4.21 -attributes have been redefined to use the special <code>{template:field-name()}</code>
4.22 +attributes have been redefined to use the special <code>{template:this-attribute()}</code>
4.23 value.</li>
4.24 <li>The <code>input</code> elements' <code>value</code>
4.25 attributes have been redefined to use the special <code>{$this-value}</code>
4.26 @@ -72,7 +72,7 @@
4.27 <h2>Completing the Template</h2>
4.28 <p>The template in full should now look something like this:</p>
4.29 <pre><?xml version="1.0"?><br /><html xmlns="http://www.w3.org/1999/xhtml"<br /> <span
4.30 - style="font-weight: bold;">xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"</span>><br /><head><br /> <title>Example</title><br /></head><br /><body template:element="structure"><br /><form action="" method="POST"><br /><br /><!-- Template text between the start and the interesting part. --><br /><br /><div template:element="item"><br /> <p><br /> Some item: <input template:attribute="value" name="{template:field-name()}" type="text" value="{$this-value}" /><br /> <input name="remove" type="submit" value="Remove" /><br /> </p><br /> <p><br /> Itself containing more items:<br /> </p><br /> <p template:element="subitem"><br /> Sub-item: <input template:attribute="subvalue" name="{template:field-name()}" type="text" value="{$this-value}" /><br /> <input name="remove2" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="add2" type="submit" value="Add subitem" /><br /> </p><br /></div><br /><p><br /> <input name="add" type="submit" value="Add item" /><br /></p><br /><br /><!-- Template text between the interesting part and the end. --><br /><br /></form><br /></body><br /></html></pre>
4.31 + style="font-weight: bold;">xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"</span>><br /><head><br /> <title>Example</title><br /></head><br /><body template:element="structure"><br /><form action="" method="POST"><br /><br /><!-- Template text between the start and the interesting part. --><br /><br /><div template:element="item"><br /> <p><br /> Some item: <input template:attribute="value" name="{template:this-attribute()}" type="text" value="{$this-value}" /><br /> <input name="remove" type="submit" value="Remove" /><br /> </p><br /> <p><br /> Itself containing more items:<br /> </p><br /> <p template:element="subitem"><br /> Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" /><br /> <input name="remove2" type="submit" value="Remove" /><br /> </p><br /> <p><br /> <input name="add2" type="submit" value="Add subitem" /><br /> </p><br /></div><br /><p><br /> <input name="add" type="submit" value="Add item" /><br /></p><br /><br /><!-- Template text between the interesting part and the end. --><br /><br /></form><br /></body><br /></html></pre>
4.32 <p>Note also that a namespace declaration is required for the <code>template</code>
4.33 attributes, and it is usually best to put this declaration on the
4.34 top-level <code>html</code> element in the template, as shown in
5.1 --- a/examples/Common/Configurator/Resources/config_template.xhtml Tue Jul 19 23:40:05 2005 +0000
5.2 +++ b/examples/Common/Configurator/Resources/config_template.xhtml Wed Jul 20 12:53:04 2005 +0000
5.3 @@ -20,7 +20,7 @@
5.4 <h2>Base System</h2>
5.5
5.6 <p template:element="base-system">Model
5.7 - <select name="{template:multi-field-name('value')}" onchange="requestUpdate('{$application-url}cpu', '{template:multi-field-name('value')}', '{template:other-field-names(../cpu)}', '{template:other-multi-field-names('value', ../cpu)}', '/configuration/details/cpu'); requestUpdate('{$application-url}memory', '{template:multi-field-name('value')}', '{template:other-field-names(../../memory)}', '{template:other-multi-field-names('value', ../../memory/memory-unit)}', '/configuration/memory'); requestUpdate('{$application-url}hard-disks', '{template:multi-field-name('value')}', '{template:other-field-names(../../hard-disks)}', '{template:other-multi-field-names('value', ../../hard-disks/hard-disk)}', '/configuration/hard-disks')">
5.8 + <select name="{template:list-attribute('value')}" onchange="requestUpdate('{$application-url}cpu', '{template:list-attribute('value')}', '{template:other-nodes(../cpu)}', '{template:other-list-attributes('value', ../cpu)}', '/configuration/details/cpu'); requestUpdate('{$application-url}memory', '{template:list-attribute('value')}', '{template:other-nodes(../../memory)}', '{template:other-list-attributes('value', ../../memory/memory-unit)}', '/configuration/memory'); requestUpdate('{$application-url}hard-disks', '{template:list-attribute('value')}', '{template:other-nodes(../../hard-disks)}', '{template:other-list-attributes('value', ../../hard-disks/hard-disk)}', '/configuration/hard-disks')">
5.9 <option template:element="base-system-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.10 value="{@value}"></option>
5.11 </select>
5.12 @@ -29,7 +29,7 @@
5.13 <h2>Processor</h2>
5.14
5.15 <p template:element="cpu">CPU
5.16 - <select template:id="cpu-node" id="{template:this-position()}" name="{template:multi-field-name('value')}">
5.17 + <select template:id="cpu-node" id="{template:this-element()}" name="{template:list-attribute('value')}">
5.18 <option template:element="cpu-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.19 value="{@value}"></option>
5.20 </select>
5.21 @@ -39,19 +39,19 @@
5.22 <div template:element="memory" class="memory">
5.23 <h2>Memory</h2>
5.24
5.25 - <div template:id="memory-node" id="{template:this-position()}">
5.26 + <div template:id="memory-node" id="{template:this-element()}">
5.27 <p template:element="memory-unit">Memory unit
5.28 - <select name="{template:multi-field-name('value')}">
5.29 + <select name="{template:list-attribute('value')}">
5.30 <option template:element="memory-unit-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.31 value="{@value}"></option>
5.32 </select>
5.33
5.34 <input type="submit" value="Remove"
5.35 - name="remove-memory-unit={template:this-position()}" /></p>
5.36 + name="remove-memory-unit={template:this-element()}" /></p>
5.37
5.38 <p>
5.39 <input type="submit" value="Add memory"
5.40 - name="add-memory-unit={template:this-position()}" /></p>
5.41 + name="add-memory-unit={template:this-element()}" /></p>
5.42 </div>
5.43 </div>
5.44 </div>
5.45 @@ -59,19 +59,19 @@
5.46 <div template:element="hard-disks" class="hard-disks">
5.47 <h2>Hard Disks</h2>
5.48
5.49 - <div template:id="hard-disks-node" id="{template:this-position()}">
5.50 + <div template:id="hard-disks-node" id="{template:this-element()}">
5.51 <p template:element="hard-disk">Hard disk drive
5.52 - <select name="{template:multi-field-name('value')}">
5.53 + <select name="{template:list-attribute('value')}">
5.54 <option template:element="hard-disk-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.55 value="{@value}"></option>
5.56 </select>
5.57
5.58 <input type="submit" value="Remove"
5.59 - name="remove-hard-disk={template:this-position()}" /></p>
5.60 + name="remove-hard-disk={template:this-element()}" /></p>
5.61
5.62 <p>
5.63 <input type="submit" value="Add hard disk"
5.64 - name="add-hard-disk={template:this-position()}" /></p>
5.65 + name="add-hard-disk={template:this-element()}" /></p>
5.66 </div>
5.67 </div>
5.68
5.69 @@ -79,17 +79,17 @@
5.70 <h2>Additional Storage</h2>
5.71
5.72 <p template:element="storage-unit">Storage unit
5.73 - <select name="{template:multi-field-name('value')}">
5.74 + <select name="{template:list-attribute('value')}">
5.75 <option template:element="storage-unit-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.76 value="{@value}"></option>
5.77 </select>
5.78
5.79 <input type="submit" value="Remove"
5.80 - name="remove-storage-unit={template:this-position()}" /></p>
5.81 + name="remove-storage-unit={template:this-element()}" /></p>
5.82
5.83 <p>
5.84 <input type="submit" value="Add storage"
5.85 - name="add-storage-unit={template:this-position()}" /></p>
5.86 + name="add-storage-unit={template:this-element()}" /></p>
5.87 </div>
5.88 </div>
5.89 <div id="bottom">
5.90 @@ -97,14 +97,14 @@
5.91 <h2>Input Devices</h2>
5.92
5.93 <p template:element="keyboard">Keyboard
5.94 - <select name="{template:multi-field-name('value')}">
5.95 + <select name="{template:list-attribute('value')}">
5.96 <option template:element="keyboard-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.97 value="{@value}"></option>
5.98 </select>
5.99 </p>
5.100
5.101 <p template:element="mouse">Mouse
5.102 - <select name="{template:multi-field-name('value')}">
5.103 + <select name="{template:list-attribute('value')}">
5.104 <option template:element="mouse-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.105 value="{@value}"></option>
5.106 </select>
5.107 @@ -113,7 +113,7 @@
5.108 <h2>Display</h2>
5.109
5.110 <p template:element="screen">Screen
5.111 - <select name="{template:multi-field-name('value')}">
5.112 + <select name="{template:list-attribute('value')}">
5.113 <option template:element="screen-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
5.114 value="{@value}"></option>
5.115 </select>
6.1 --- a/examples/Common/PEP241/Resources/pep241_template.xhtml Tue Jul 19 23:40:05 2005 +0000
6.2 +++ b/examples/Common/PEP241/Resources/pep241_template.xhtml Wed Jul 20 12:53:04 2005 +0000
6.3 @@ -23,22 +23,22 @@
6.4 <tr>
6.5 <th>Package name</th>
6.6 <td template:attribute="name"><input type="text" size="20"
6.7 - name="{template:field-name()}" value="{$this-value}" /></td>
6.8 + name="{template:this-attribute()}" value="{$this-value}" /></td>
6.9 </tr>
6.10 <tr>
6.11 <th>Package version</th>
6.12 <td template:attribute="version"><input type="text" size="10"
6.13 - name="{template:field-name()}" value="{$this-value}" /></td>
6.14 + name="{template:this-attribute()}" value="{$this-value}" /></td>
6.15 </tr>
6.16 <tr>
6.17 <th>Summary</th>
6.18 <td template:attribute="summary"><input type="text" size="20"
6.19 - name="{template:field-name()}" value="{$this-value}" /></td>
6.20 + name="{template:this-attribute()}" value="{$this-value}" /></td>
6.21 </tr>
6.22 <tr>
6.23 <th>Description</th>
6.24 <td template:attribute="description"><textarea cols="80" rows="5"
6.25 - name="{template:field-name()}">
6.26 + name="{template:this-attribute()}">
6.27 <span template:value="$this-value" template:effect="replace">Insert
6.28 longer description here!</span></textarea></td>
6.29 </tr>
6.30 @@ -50,12 +50,12 @@
6.31 <tr>
6.32 <th>Home page</th>
6.33 <td template:attribute="home-page"><input type="text" size="80"
6.34 - name="{template:field-name()}" value="{$this-value}" /></td>
6.35 + name="{template:this-attribute()}" value="{$this-value}" /></td>
6.36 </tr>
6.37 <tr>
6.38 <th>Licence</th>
6.39 <td template:attribute="licence"><input type="text" size="20"
6.40 - name="{template:field-name()}" value="{$this-value}" /></td>
6.41 + name="{template:this-attribute()}" value="{$this-value}" /></td>
6.42 </tr>
6.43 <tr>
6.44 <th colspan="2" class="heading">Categories</th>
6.45 @@ -63,7 +63,7 @@
6.46 <tr template:element="categories">
6.47 <th>Categories</th>
6.48 <td>
6.49 - <select template:element="category" name="{template:multi-field-name('value')}" multiple="multiple">
6.50 + <select template:element="category" name="{template:list-attribute('value')}" multiple="multiple">
6.51 <option template:element="category-enum" template:expr-attr="selected" template:expr="@value-is-set" template:value="@value"
6.52 value="{@value}"></option>
6.53 </select>
6.54 @@ -74,31 +74,31 @@
6.55 </tr>
6.56 <tr template:element="platforms,platform">
6.57 <th>Platform name</th>
6.58 - <td><span template:attribute="name"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></span>
6.59 + <td><span template:attribute="name"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></span>
6.60 <input type="submit" value="Remove!"
6.61 - name="remove_platform={template:this-position()}" /></td>
6.62 + name="remove_platform={template:this-element()}" /></td>
6.63 </tr>
6.64 <tr>
6.65 <th></th>
6.66 <td>
6.67 <input type="submit" value="Add platform!"
6.68 - name="add_platform={template:this-position()}" /></td>
6.69 + name="add_platform={template:this-element()}" /></td>
6.70 </tr>
6.71 <tr>
6.72 <th colspan="2" class="heading">Supported platforms</th>
6.73 </tr>
6.74 <tr template:element="supported-platforms,supported-platform">
6.75 <th>Platform name</th>
6.76 - <td><span template:attribute="name"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></span>
6.77 + <td><span template:attribute="name"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></span>
6.78 <input type="submit" value="Remove!"
6.79 - name="remove_supported_platform={template:this-position()}"
6.80 + name="remove_supported_platform={template:this-element()}"
6.81 /></td>
6.82 </tr>
6.83 <tr>
6.84 <th></th>
6.85 <td>
6.86 <input type="submit" value="Add platform!"
6.87 - name="add_supported_platform={template:this-position()}"
6.88 + name="add_supported_platform={template:this-element()}"
6.89 /></td>
6.90 </tr>
6.91 <tr>
6.92 @@ -106,15 +106,15 @@
6.93 </tr>
6.94 <tr template:element="keywords,keyword">
6.95 <th>Keyword</th>
6.96 - <td><span template:attribute="name"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></span>
6.97 + <td><span template:attribute="name"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></span>
6.98 <input type="submit" value="Remove!"
6.99 - name="remove_keyword={template:this-position()}" /></td>
6.100 + name="remove_keyword={template:this-element()}" /></td>
6.101 </tr>
6.102 <tr>
6.103 <th></th>
6.104 <td>
6.105 <input type="submit" value="Add keyword!"
6.106 - name="add_keyword={template:this-position()}" /></td>
6.107 + name="add_keyword={template:this-element()}" /></td>
6.108 </tr>
6.109 <tr>
6.110 <th colspan="2" class="heading">Authors</th>
6.111 @@ -123,17 +123,17 @@
6.112 <tbody template:element="authors,author">
6.113 <tr>
6.114 <th>Author name</th>
6.115 - <td><span template:attribute="name"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></span>
6.116 + <td><span template:attribute="name"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></span>
6.117 <input type="submit" value="Remove!"
6.118 - name="remove_author={template:this-position()}" /></td>
6.119 + name="remove_author={template:this-element()}" /></td>
6.120 </tr>
6.121 <tr>
6.122 <th>Author contact</th>
6.123 - <td template:attribute="contact"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></td>
6.124 + <td template:attribute="contact"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></td>
6.125 </tr>
6.126 <tr>
6.127 <th>Author e-mail</th>
6.128 - <td template:attribute="e-mail"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></td>
6.129 + <td template:attribute="e-mail"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></td>
6.130 </tr>
6.131 </tbody>
6.132 <tbody>
6.133 @@ -141,7 +141,7 @@
6.134 <th></th>
6.135 <td>
6.136 <input type="submit" value="Add author!"
6.137 - name="add_author={template:this-position()}" /></td>
6.138 + name="add_author={template:this-element()}" /></td>
6.139 </tr>
6.140 <tr>
6.141 <th colspan="2" class="heading">Dependencies</th>
6.142 @@ -150,13 +150,13 @@
6.143 <tbody template:element="dependencies,dependency">
6.144 <tr>
6.145 <th>Package name</th>
6.146 - <td><span template:attribute="name"><input name="{template:field-name()}" value="{$this-value}" type="text" size="20" /></span>
6.147 + <td><span template:attribute="name"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="20" /></span>
6.148 <input type="submit" value="Remove!"
6.149 - name="remove_dependency={template:this-position()}" /></td>
6.150 + name="remove_dependency={template:this-element()}" /></td>
6.151 </tr>
6.152 <tr>
6.153 <th>Package version</th>
6.154 - <td template:attribute="version"><input name="{template:field-name()}" value="{$this-value}" type="text" size="10" /></td>
6.155 + <td template:attribute="version"><input name="{template:this-attribute()}" value="{$this-value}" type="text" size="10" /></td>
6.156 </tr>
6.157 </tbody>
6.158 <tbody>
6.159 @@ -164,7 +164,7 @@
6.160 <th></th>
6.161 <td>
6.162 <input type="submit" value="Add dependency!"
6.163 - name="add_dependency={template:this-position()}" /></td>
6.164 + name="add_dependency={template:this-element()}" /></td>
6.165 </tr>
6.166 <tr>
6.167 <th colspan="2" class="heading">Actions</th>
7.1 --- a/examples/Common/Questionnaire/Resources/question_template.xhtml Tue Jul 19 23:40:05 2005 +0000
7.2 +++ b/examples/Common/Questionnaire/Resources/question_template.xhtml Wed Jul 20 12:53:04 2005 +0000
7.3 @@ -22,44 +22,44 @@
7.4 <tr>
7.5 <th class="question">Question</th>
7.6 <td class="question" template:attribute="question-text"><textarea cols="40" rows="4"
7.7 - name="{template:field-name()}" template:value="$this-value">Question</textarea></td>
7.8 + name="{template:this-attribute()}" template:value="$this-value">Question</textarea></td>
7.9 <td class="question-options">
7.10 - <input type="submit" value="Remove question" name="remove-question={template:this-position()}"
7.11 + <input type="submit" value="Remove question" name="remove-question={template:this-element()}"
7.12 /></td>
7.13 </tr>
7.14 <tr>
7.15 <th class="response">Response</th>
7.16 <td class="response" template:attribute="question-type"><input type="radio"
7.17 - name="{template:field-name()}" value="text" template:expr-attr="checked"
7.18 + name="{template:this-attribute()}" value="text" template:expr-attr="checked"
7.19 template:expr="$this-value = 'text'" /> Text</td>
7.20 <td></td>
7.21 </tr>
7.22 <tr>
7.23 <td class="response"></td>
7.24 <td class="response" template:attribute="response-text"><input type="text" size="40"
7.25 - name="{template:field-name()}" value="{$this-value}" /></td>
7.26 + name="{template:this-attribute()}" value="{$this-value}" /></td>
7.27 <td></td>
7.28 </tr>
7.29 <tr>
7.30 <td class="response"></td>
7.31 <td class="response" template:attribute="question-type"><input type="radio"
7.32 - name="{template:field-name()}" value="choice" template:expr-attr="checked"
7.33 + name="{template:this-attribute()}" value="choice" template:expr-attr="checked"
7.34 template:expr="$this-value = 'choice'" /> Multiple choice</td>
7.35 <td></td>
7.36 </tr>
7.37 <tr template:element="choice">
7.38 <td class="response"></td>
7.39 <td class="choice" template:attribute="response-choice"><input type="text" size="40"
7.40 - name="{template:field-name()}" value="{$this-value}" /></td>
7.41 + name="{template:this-attribute()}" value="{$this-value}" /></td>
7.42 <td class="choice-options">
7.43 - <input type="submit" value="Remove choice" name="remove-choice={template:this-position()}"
7.44 + <input type="submit" value="Remove choice" name="remove-choice={template:this-element()}"
7.45 /></td>
7.46 </tr>
7.47 <tr>
7.48 <td class="response"></td>
7.49 <td class="response"></td>
7.50 <td class="response">
7.51 - <input type="submit" value="Add choice" name="add-choice={template:this-position()}"
7.52 + <input type="submit" value="Add choice" name="add-choice={template:this-element()}"
7.53 /></td>
7.54 </tr>
7.55 </tbody>
8.1 --- a/examples/Common/VerySimple/Resources/structure_template.xhtml Tue Jul 19 23:40:05 2005 +0000
8.2 +++ b/examples/Common/VerySimple/Resources/structure_template.xhtml Wed Jul 20 12:53:04 2005 +0000
8.3 @@ -13,12 +13,12 @@
8.4
8.5 <div template:element="item">
8.6 <p>
8.7 - Some item: <input template:attribute="value" name="{template:field-name()}" type="text" value="{$this-value}" />
8.8 - <input name="remove={template:this-position()}" type="submit" value="Remove" />
8.9 + Some item: <input template:attribute="value" name="{template:this-attribute()}" type="text" value="{$this-value}" />
8.10 + <input name="remove={template:this-element()}" type="submit" value="Remove" />
8.11 </p>
8.12 <p>
8.13 Item type:
8.14 - <select template:element="type" name="{template:new-field('value')}">
8.15 + <select template:element="type" name="{template:new-attribute('value')}">
8.16 <option template:element="type-enum" template:expr="@value = ../@value" template:expr-attr="selected"
8.17 template:value="@value" value="{@value}" />
8.18 </select>
8.19 @@ -27,15 +27,15 @@
8.20 Itself containing more items:
8.21 </p>
8.22 <p template:element="subitem">
8.23 - Sub-item: <input template:attribute="subvalue" name="{template:field-name()}" type="text" value="{$this-value}" />
8.24 - <input name="remove2={template:this-position()}" type="submit" value="Remove" />
8.25 + Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" />
8.26 + <input name="remove2={template:this-element()}" type="submit" value="Remove" />
8.27 </p>
8.28 <p>
8.29 - <input name="add2={template:this-position()}" type="submit" value="Add subitem" />
8.30 + <input name="add2={template:this-element()}" type="submit" value="Add subitem" />
8.31 </p>
8.32 </div>
8.33 <p>
8.34 - <input name="add={template:this-position()}" type="submit" value="Add item" />
8.35 + <input name="add={template:this-element()}" type="submit" value="Add item" />
8.36 </p>
8.37
8.38 <!-- Template text between the interesting part and the end. -->