The alert() function
The alert() function returns the alert belonging to a specific node or the alert of an element with a corresponding id attribute.
XML | Copy Code |
---|---|
string sxf:alert(node or id) |
When the parameter represents an Xml node, the contents of the (first) alert element bound to this node will be returned.
Otherwise, the parameter is interpreted as string and will be used to find an xforms element with corresponding id attribute. If found, the label contents of this element is then returned.
Example:
XML | Copy Code |
---|---|
<xf:group appearance="compact"> <strong>Error summary :</strong> <xf:repeat nodeset="sxf:filterbyproperty(/a:Address/*,'valid',false())"> <xf:output value="concat(substring-before(sxf:label(node()),':'), ' - ', sxf:alert(node()))" /> </xf:repeat> </xf:group> |
Within the above example, the label (and alert) extension functions are used to generate a summary of invalid nodes. The invalid nodes are determined using the filterbyproperty extension function.
Namespaces
This function is available within the Smartsite XForms namespace (http://smartsite.nl/namespaces/xforms/1.0).