Finds elements by the specified Element Location Path interpreted against the specified context element and returns the first of the found elements. If no elements found, the function returns null.

Effectively, this function does the same as one of the following calls (however, it will work faster!):


findElementsByLPath (
  element,
  lpath
).next().toElement()
or

findElementsByLPath(lpath).next().toElement()

Parameters:

element

The context element against which the Location Path is interpreted.

If this parameter is not specified, the Location Path will be interpreted against the generator context element, which is the same as the call: contextElement.findElementByLPath(lpath)

See Also: GOMContext.contextElement

lpath
The Location Path expression specifying how the elements should be searched.

You may use the Location Path Builder (found at the left panel's tree) to quickly construct a Location Path needed for this parameter.

See Also:

findElementsByLPath(), findElementByLRules(), findChild()

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