MIP functions
The valid() Function
See the spec-ready text in the XPath Expressions Module.
The relevant() Function
boolean relevant(node-set?)
The relevant() returns the relevant state of the node from the node-set which is first in document order. If the node-set is empty then the function returns false. If the argument is omitted, it defaults to a node-set with the context node as its only member. If the function is used in binding expressions or in a model binding expression then an xforms-compute-exception should be dispatched and processing terminated.
Example: how to use relevant()
<xforms:model>
<xforms:instance>
<data xmlns="">
<node1/>
<node2/>
</data>
</xforms:instance>
<xforms:bind nodeset="data1" relevant="false()"/>
</xforms:model>
<xforms:repeat nodeset="*[relevant()]">
<xf:input ref=".">
<xf:label>All relevant nodes (node2)</xf:label>
</xf:input>
</xforms:repeat>
The readonly() Function
boolean readonly(node-set?)
The readonly() returns the readonly state of the node from the node-set which is first in document order. If the node-set is empty then the function returns false. If the argument is omitted, it defaults to a node-set with the context node as its only member. If the function is used in binding expressions or in a model binding expression then an xforms-compute-exception should be dispatched and processing terminated.
Example: how to use readonly()
<xforms:model>
<xforms:instance>
<data xmlns="" readonly="false">Data</data>
</xforms:instance>
<xforms:bind nodeset="/data" readonly="@readonly"/>
</xforms:model>
<xforms:repeat nodeset="*[not(readonly())]">
<xf:input ref=".">
<xf:label>All nodes that are readwrite:</xf:label>
</xf:input>
</xforms:repeat>
The required() Function
boolean required(node-set?)
The required() returns the required state of the node from the node-set which is first in document order. If the node-set is empty then the function returns false. If the argument is omitted, it defaults to a node-set with the context node as its only member. If the function is used in binding expressions or in a model binding expression then an xforms-compute-exception should be dispatched and processing terminated.
Example: how to use required()
<xforms:model>
<xforms:instance>
<data xmlns="" required="false">Data</data>
</xforms:instance>
<xforms:bind nodeset="." required="boolean-from-string(@required)"/>
</xforms:model>
...
<xforms:value output="concat('element required is ', required(/data))"/>