This function receives the specified enumeration of the source elements (i.e. GOMElement objects) and returns another enumeration containing only those elements that comply with the target Element Type(s) and/or satisfy the filtering conditions specified in the form of a boolean subexpression evaluated against every element. The initial element ordering is preserved.

Parameters:

elementEnum

The enumeration of the source elements
elementTypeSpec
The list of target Element Types (see "Specifying Matching Element Types" below).

When this parameter is specified, every element to be included in the result enumeration should comply with at least one of the target Element Types.

filterQuery
The filtering conditions for the result elements.

When specified, this should be a boolean subquery created with BooleanQuery() function. The subquery will be processed against each initially selected element and should return true if the element must be included in the result enumeration and false otherwise. The tested element is passed as the generator context element.

Example:


className = getAttrStringValue("name");
e.filterElements ("Method", 
  BooleanQuery (
    getAttrStringValue("class") == className
  )
);
This expression returns an enumeration of those elements contained in the source enumeration 'e', which are
  1. instances of 'Method' Element Type;
  2. whose 'class' attribute has a value equal to the value of the 'name' attribute of the generator's current context element.

See Also:

BooleanQuery(), filterElementsByKey()

${include ../../../refs/matching_ets_spec.htm}

${include ../../../refs/element_types.htm}