countChildrenAdded by IBM on August 8, 2013 | Version 1 (Original)
|Counts the number of children that belong to a form element.
Note that this count includes all global elements, such as global pages and global items, if they are child nodes. Additionally, the count includes elements that are not written out with form but are included when the form is in memory, such as activated, pageprevious, pagenext, itemprevious, and itemnext.
Table 1. countChildren parameters
countChildren(reference, referenceType, scheme)
|reference||Reference string||A reference to the element containing the child elements.|
|referenceType||String||Optional. Identifies the type of reference used in the reference parameter. Valid settings are: form, page,item , option, and array. An array is anything under the option level in the form.|
|scheme||String||Optional. The scheme used to write the reference. Defaults value is XFDL. This parameter requires the referenceType parameter.|
Returns An integer representing the number of child elements or an empty string if an error occurs.
Example In this example, the countChildren function calculates the number of items on the page. Note that the compute subtracts one from this total to account for the global item.
<value compute="countChildren('Page1', 'page') - 1"></value>