XSLTools

Change of docs/advice.html

415:778a1752a071
docs/advice.html
     1.1 --- a/docs/advice.html	Thu Nov 17 19:46:28 2005 +0000
     1.2 +++ b/docs/advice.html	Thu Nov 17 23:47:08 2005 +0000
     1.3 @@ -58,7 +58,7 @@
     1.4  the&nbsp;<code>author</code> element into the XML document when
     1.5  creating the&nbsp;<code>package</code> element - this should then
     1.6  "bootstrap" the process and ensure that the author details will remain
     1.7 -editable as long as the&nbsp;<code>package</code> element exists.</p><h3>Ensuring Element Structure with Document Initialisation</h3><p>Although it is not necessary to use <a href="multiple.html">document initialisation</a> in resources, the above case would be detected by an input/initialiser stylesheet, and the&nbsp;<code>package</code> and <code>author</code> elements would be added if no way of adding them was mentioned in the template. Typically, we would employ <a href="selectors.html">selectors</a> to provide the ability to add elements in templates, and the above example could be extended as follows:</p><pre>&lt;p template:element="package"&gt;<br />  &lt;p template:element="author"&gt;<br />    Name: &lt;input template:attribute-field="name" name="..." type="text" value="..."/&gt;<br />  &lt;/p&gt;<br />  &lt;p&gt;<br />    &lt;input name="..." template:selector-field="add-author,author" type="submit" value="Add author" /&gt;<br />  &lt;/p&gt;<br />&lt;/p&gt;</pre><p>With the newly-added selector, we can see that <code>author</code> elements could at least be added by users of the application, but <code>package</code>
     1.8 +editable as long as the&nbsp;<code>package</code> element exists.</p><h3>Ensuring Element Structure with Document Initialisation</h3><p>Although it is not necessary to use <a href="multiple.html#DocumentInitialisation">document initialisation</a> in resources, the above case would be detected by an input/initialiser stylesheet, and the&nbsp;<code>package</code> and <code>author</code> elements would be added if no way of adding them was mentioned in the template. Typically, we would employ <a href="selectors.html">selectors</a> to provide the ability to add elements in templates, and the above example could be extended as follows:</p><pre>&lt;p template:element="package"&gt;<br />  &lt;p template:element="author"&gt;<br />    Name: &lt;input template:attribute-field="name" name="..." type="text" value="..."/&gt;<br />  &lt;/p&gt;<br />  &lt;p&gt;<br />    &lt;input name="..." template:selector-field="add-author,author" type="submit" value="Add author" /&gt;<br />  &lt;/p&gt;<br />&lt;/p&gt;</pre><p>With the newly-added selector, we can see that <code>author</code> elements could at least be added by users of the application, but <code>package</code>
     1.9  elements would still be impossible to create in the user interface. The
    1.10  document initialisation mechanism distinguishes between these two cases
    1.11  by looking for selectors which mention element names; here, the <code>template:selector-field</code> attribute has two parts to its value:</p><ol><li>A name used to identify the selector.</li><li>The name of an element: <code>author</code></li></ol><p>Since the <code>author</code>