Searches the specified array (or vector) for the first occurrence of an element that complies with the filter condition.
Parameters:
elements
Note: The array (or vector) is expected to contain objects representing
DSM (Data Source Model) elements, that is GOMElement
or
DSMElement
objects. Objects of any other types will be ignored.
filterQuery
This should be a boolean subquery created with BooleanQuery()
function.
The subquery will be processed against each initially selected element.
It must return true
if the element should be returned and
false
if it should be ignored.
The tested element is passed as the generator context element.
If no such an element found (or elements == null
),
the function returns null
.
The following expression searched the specified vector (or array)
for the first occurrence of an element with 'xs:group'
type:
findElementByFilter (
elements,
BooleanQuery (instanceOf ("xs:group"))
)
findElementByType (elements, "xs:group")
BooleanQuery(), findElementByType()