The filterbyproperty() function

Release 2.0 - ...

The filterbyproperty() extension function can be used to evaluate model item properties for the specified node-set, such as readonly and required, as well as the valid state.

  CopyCode image Copy Code
node-set filterbyproperty(node-set expression[], propertyname, compare value)

It returns a node-set, which can then be used to iterate through the nodes.

Parameters:

  • node-set expression(s): comma-seperated list of one or more node-set expressions.
  • propertyname: the (model item) property to evaluate; legal values are: required, readonly, relevant, constraint and valid.
  • the compare value (boolean expression): e.g. whether to return valid or invalid nodes. Defaults to false().

Example:

  CopyCode image Copy Code
sxf:filterbyproperty(/a:Address/*,'valid',false())

This example returns a node-set containing all the children of a:Address for which the valid state property equals false().

Namespace

This function is available within the Smartsite XForms namespace (http://smartsite.nl/namespaces/xforms/1.0).