1.1 --- a/docs/JavaScript-reference.html Fri Nov 11 17:14:22 2005 +0000
1.2 +++ b/docs/JavaScript-reference.html Mon Nov 14 19:33:39 2005 +0000
1.3 @@ -5,4 +5,4 @@
1.4 <title>JavaScript Function Reference</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.5 <link href="styles.css" rel="stylesheet" type="text/css" /></head>
1.6 <body>
1.7 -<h1>JavaScript Function References</h1><p>The following JavaScript functions are available for the triggering of in-page updates:</p><h2>requestUpdateArea</h2><p>Parameters:</p><dl><dt><code>url</code></dt><dd>The URL (which may be relative to the current page or resource) to which the update shall be sent. For example:<br /><pre>'platforms'</pre>The above example causes an update to be sent to the location <code>platforms</code> relative to the current page.</dd><dt><code>sourceAreasStr</code></dt><dd>A comma-separated list of regions in the form data which affect the outcome of the update. For example:<br /><pre>'/package$1/platforms$1'</pre>Typically, one would use an <a href="../apidocs/public/XSLForms.Output-module.html">XSLT/template function</a> to provide such information. For example:<br /><pre>'{template:other-elements(..)}'</pre>Selector fields may be specified in addition to regions:<br /><pre>'{template:selector-name('remove_platform', .)}'</pre>The above example causes the <code>remove_platform</code> selector field to be included in the update.</dd><dt><code>targetName</code></dt><dd>The element identifier (specified by an HTML or XML <code>id</code> attribute) within which the outcome of the update shall appear.</dd><dt><code>targetAreasStr</code></dt><dd>A comma-separated list of regions in the form data which are affected by the update. See the <code>sourceAreasStr</code> parameter for more details.</dd><dt><code>elementPath</code></dt><dd>A simple path into the form data, defining the scope of the update.</dd></dl><h2>requestUpdate</h2><p>Parameters:</p><dl><dt><code>url</code></dt><dd>The URL (which may be relative to the current page or resource) to which the update shall be sent. See the description of the <code>url</code> parameter for the <code>requestUpdateArea</code> function for more details.</dd><dt><code>fieldNamesStr</code></dt><dd>A comma-separated list of fields in the form data which affect the outcome of the update. For example:<br /><pre>'/package$1/name'</pre>Typically, one would use an <a href="../apidocs/public/XSLForms.Output-module.html">XSLT/template function</a> to provide such information. For example:<br /><pre>'{template:other-attributes('name', .)}'</pre>The above example causes the field associated with the <code>name</code> attribute on the current element to be included in the update.</dd><dt><code>targetName</code></dt><dd>The element identifier (specified by an HTML or XML <code>id</code> attribute) within which the outcome of the update shall appear.</dd><dt><code>targetFieldNamesStr</code></dt><dd>A comma-separated list of fields in the form data which are affected by the update. See the <code>fieldNamesStr</code> parameter for more details.</dd><dt><code>elementPath</code></dt><dd>A simple path into the form data, defining the scope of the update.</dd></dl></body></html>
1.8 \ No newline at end of file
1.9 +<h1>JavaScript Function References</h1><p>The following JavaScript functions are available for the triggering of in-page updates:</p><h2>requestUpdateArea</h2><p>Parameters:</p><dl><dt><code>url</code></dt><dd>The URL (which may be relative to the current page or resource) to which the update shall be sent. For example:<br /><pre>'platforms'</pre>The above example causes an update to be sent to the location <code>platforms</code> relative to the current page.</dd><dt><code>sourceAreasStr</code></dt><dd>A comma-separated list of regions in the form data which affect the outcome of the update. For example:<br /><pre>'/package$1/platforms$1'</pre>Typically, one would use an <a href="../apidocs/public/XSLForms.Output-module.html">template extension function</a> to provide such information. For example:<br /><pre>'{template:other-elements(..)}'</pre>Selector fields may be specified in addition to regions:<br /><pre>'{template:selector-name('remove_platform', .)}'</pre>The above example causes the <code>remove_platform</code> selector field to be included in the update.</dd><dt><code>targetName</code></dt><dd>The element identifier (specified by an HTML or XML <code>id</code> attribute) within which the outcome of the update shall appear.</dd><dt><code>targetAreasStr</code></dt><dd>A comma-separated list of regions in the form data which are affected by the update. See the <code>sourceAreasStr</code> parameter for more details.</dd><dt><code>elementPath</code></dt><dd>A simple path into the form data, defining the scope of the update.</dd></dl><h2>requestUpdate</h2><p>Parameters:</p><dl><dt><code>url</code></dt><dd>The URL (which may be relative to the current page or resource) to which the update shall be sent. See the description of the <code>url</code> parameter for the <code>requestUpdateArea</code> function for more details.</dd><dt><code>fieldNamesStr</code></dt><dd>A comma-separated list of fields in the form data which affect the outcome of the update. For example:<br /><pre>'/package$1/name'</pre>Typically, one would use an <a href="../apidocs/public/XSLForms.Output-module.html">template extension function</a> to provide such information. For example:<br /><pre>'{template:other-attributes('name', .)}'</pre>The above example causes the field associated with the <code>name</code> attribute on the current element to be included in the update.</dd><dt><code>targetName</code></dt><dd>The element identifier (specified by an HTML or XML <code>id</code> attribute) within which the outcome of the update shall appear.</dd><dt><code>targetFieldNamesStr</code></dt><dd>A comma-separated list of fields in the form data which are affected by the update. See the <code>fieldNamesStr</code> parameter for more details.</dd><dt><code>elementPath</code></dt><dd>A simple path into the form data, defining the scope of the update.</dd></dl></body></html>
1.10 \ No newline at end of file
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/docs/advanced.html Mon Nov 14 19:33:39 2005 +0000
2.3 @@ -0,0 +1,71 @@
2.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2.5 +<html xmlns="http://www.w3.org/1999/xhtml"><head>
2.6 + <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
2.7 +
2.8 + <title>Advanced Template Design</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
2.9 + <link href="styles.css" rel="stylesheet" type="text/css" /></head>
2.10 +<body>
2.11 +<h1>Advanced Template Design</h1>
2.12 +<p>In the "Template Design" document, the special XSLForms annotations
2.13 +were presented as a means to display the information contained in form
2.14 +data documents (or just general XML documents with no special
2.15 +connection to Web forms). However, since XSLForms templates build upon
2.16 +XSL transformations, it is also possible to employ certain XSL
2.17 +techniques to present the information in various different ways.</p><h2>Templates and Transformations</h2><p>When
2.18 +"prepared", XSLForms templates are converted to XSL stylesheets, and
2.19 +when form data is "displayed", such XSL stylesheets are used to
2.20 +transform the form data to a representation which looks like the
2.21 +original template, but with different parts of the template populated
2.22 +with the "displayed" form data. The process can be illustrated as
2.23 +follows:</p><table style="text-align: left; width: 80%;" align="center" border="0" cellpadding="5" cellspacing="5">
2.24 +
2.25 + <tbody>
2.26 +
2.27 + <tr>
2.28 +
2.29 +
2.30 +
2.31 + <th style="border: 1px solid rgb(0, 0, 0); background-color: rgb(193, 255, 102); text-align: center; vertical-align: top;">Template<br />
2.32 +
2.33 + <span class="method">A template presents the general form of the final output.</span></th>
2.34 +
2.35 + <th style="border-style: solid; border-width: 1px; text-align: center; vertical-align: top;">Stylesheet<br />
2.36 +
2.37 + <span class="method">Templates are converted to stylesheets, which are like programs specially designed to present XML information.</span></th>
2.38 +
2.39 + <th style="border: 1px solid rgb(0, 0, 0); background-color: rgb(255, 204, 255); text-align: center; vertical-align: top;">Output<br />
2.40 +
2.41 + <span class="method">The final output is produced when a stylesheet is combined with an XML document.</span></th>
2.42 +
2.43 + </tr>
2.44 +
2.45 +
2.46 +
2.47 +
2.48 + </tbody>
2.49 +</table><p>Since the stylesheet is based on XSL, which is a rich
2.50 +language in its own right, advanced template design techniques can
2.51 +involve some of the features of XSL - at least those which do not
2.52 +affect the simplicity or general structure of our templates.</p><h2>Template Extension Functions and Variables</h2><p>One
2.53 +area where XSL features are already employed to affect the final output
2.54 +in XSLForms is in the toolkit's use of template extension
2.55 +functions and special variables - the latter being used in the output
2.56 +production process. For example, we might decide to use the lower level
2.57 +template functions to present the value of an attribute:</p><pre><span template:attribute="some-attribute" template:value="$this-value">xxx</span></pre><p>In the above example, we reference the special variable <code>$this-value</code> which refers to the value of <code>some-attribute</code>. An example of template functions in use looks like this:</p><pre><span id="{template:this-element()}">xxx</span></pre><p>In the above example, we invoke the template function <code>template:this-element</code>
2.58 +in order to create a unique identifier in the final output. Since we
2.59 +use the function inside an attribute which is not prefixed with <code>template</code>, we must enclose the expression between <code>{</code> and <code>}</code> characters.</p><h2>Beyond Template Extension Functions</h2><p>Since
2.60 +the above template extension functions and variables are merely special in the
2.61 +sense that XSLForms provides them to produce its output, and since they
2.62 +are accessed in the stylesheet using normal XSL-based mechanisms, there
2.63 +is no technical barrier to using other kinds of valid XSL (or more
2.64 +precisely, XPath) expressions in cases such as those given above. The
2.65 +rules for using such expressions in attributes are straightforward:</p><ul><li>Attributes prefixed with <code>template</code> can contain expressions as one would write them normally.</li><li>Other attributes must have their expressions enclosed between <code>{</code> and <code>}</code> characters so that the expression is evaluated and replaced with the result in the final output.</li></ul><p>Here is a trivial example of the usage of an XPath expression, based on one of the above examples:</p><pre><span template:attribute="some-attribute" template:value="string-length($this-value)">xxx</span></pre><p>In the above example, we invoke the standard XPath function <code>string-length</code> in order to produce within the <code>span</code> element the length of the value of <code>some-attribute</code> (instead of the actual value).</p><p>More
2.66 +interesting applications of XPath expressions and non-XSLForms
2.67 +functions arise when using more of the potential of XPath to select
2.68 +arbitrary elements and attributes and to perform calculations on the
2.69 +selected nodes. The following example originates from the Configurator
2.70 +example application:</p><pre><span template:value="sum(/configuration//*[@value-is-set]/@price) + sum(/configuration//*[@value = ../@value]/@price)"></span></pre><p>This complicated expression, to be inserted within the <code>span</code> element, finds all elements in the system configuration having the <code>value-is-set</code>
2.71 +attribute and adds their prices together; this total is combined with
2.72 +the sum of the prices from all elements marked as selected in their
2.73 +respective lists. In other words, it gets the total of all selected
2.74 +components and inserts it into the final output.</p></body></html>
2.75 \ No newline at end of file
3.1 --- a/docs/overview.html Fri Nov 11 17:14:22 2005 +0000
3.2 +++ b/docs/overview.html Mon Nov 14 19:33:39 2005 +0000
3.3 @@ -6,7 +6,9 @@
3.4 <link href="styles.css" rel="stylesheet" type="text/css" /></head>
3.5 <body>
3.6 <h1>Creating Applications: An Overview</h1>
3.7 -<p>The following steps briefly describe how to make a new application:<br />
3.8 +<p>This document contains an overview of the process of developing an
3.9 +XSLForms application. Since the only currently supported way of
3.10 +deploying such an application is through the use of <a href="http://www.boddie.org.uk/python/WebStack.html">WebStack</a>, it is necessary to install that package first before following the tutorial below.</p><p>The following steps briefly describe how to make a new application:<br />
3.11 </p>
3.12 <ol>
3.13 <li><a href="directory.html">Create a directory to hold your files</a></li>
3.14 @@ -20,5 +22,5 @@
3.15 <li><a href="multivalue.html">Adding multivalued fields</a></li>
3.16 <li><a href="advice.html">Recommendations and advice</a></li>
3.17 <li><a href="in-page-updates.html">Adding in-page updates</a></li>
3.18 -</ol><p>A topic-by-topic guide to XSLTools:</p><ul><li><a href="template-design.html">A guide to template design</a></li><li><a href="XSLForms-resource.html">Using the XSLFormsResource API</a></li><li>Using Qt Designer to make templates <span style="font-style: italic;">(to be written)</span></li><li>Developing applications for PyQt and the Web <span style="font-style: italic;">(to be written)</span></li></ul><p>Some other resources:</p><ul><li><a href="reference.html">A template attribute reference</a></li><li><a href="../apidocs/public/XSLForms.Output-module.html">An XSLT/template extension function reference</a></li><li><a href="JavaScript-reference.html">An in-page update JavaScript function reference</a></li></ul>
3.19 +</ol><p>A topic-by-topic guide to XSLTools:</p><ul><li><a href="template-design.html">A guide to template design</a></li><li><a href="advanced.html">Advanced template design</a></li><li><a href="XSLForms-resource.html">Using the XSLFormsResource API</a></li><li>Using Qt Designer to make templates <span style="font-style: italic;">(to be written)</span></li><li>Developing applications for PyQt and the Web <span style="font-style: italic;">(to be written)</span></li></ul><p>Some other resources:</p><ul><li><a href="reference.html">A template attribute reference</a></li><li><a href="../apidocs/public/XSLForms.Output-module.html">A template extension function reference</a></li><li><a href="JavaScript-reference.html">An in-page update JavaScript function reference</a></li></ul>
3.20 </body></html>
3.21 \ No newline at end of file