411 REFERENCE · Wikibooks
XForms/Form Designers
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<head>
Example of binding to inputs and output ids
<xf:model id="model">
<xf:instance id="input">
3
3
</xf:instance>
<xf:bind id="input-one-bind" nodeset="/Data/InputValueOne" type="xs:integer"/>
<xf:bind id="input-two-bind" nodeset="/Data/InputValueTwo" type="xs:integer"/>
<xf:instance id="output">
9
</xf:instance>
<xf:bind id="output-bind" nodeset="instance('output')/OutputValue" calculate="instance('input')/InputValueOne * instance('input')/InputValueTwo" type="xs:integer"/>
</xf:model>
</head>
<body>
<p>
<xf:range bind="input-one-bind" start="1" end="5" step="1" incremental="true">
<xf:label>Input: </xf:label>
</xf:range>
<xf:range bind="input-two-bind" start="1" end="5" step="1" incremental="true">
<xf:label>Input: </xf:label>
</xf:range>
<xf:output bind="input-one-bind"/> * <xf:output bind="input-two-bind"/> =
<xf:output bind="output-bind"/>
</p>
</body>
</html>