The Find From Here context menu item enables you to perform a search within a script. It calls findNodesByPattern() on the selected node and populates the Search Results pane with the nodes that are returned.
The most important parts of scripts are the searches that you use to locate DOM content that is relevant to what is intended.
To search in the DOM, you can use a search pattern that begins with “/” which is interpreted as an absolute path, from the root of the document. If you do not use “/”, the pattern is assumed to be relative to the node.
Search from a node rules:
If a pattern begins with “/”, the search starts from the root of the DOM, otherwise from the selected node
If square brackets ([]) are entered after a node name in the pattern, then the node must have a property that satisfies the given restriction
A restriction can specify a property name, a value, or both
More than one restriction for any node can be included
Using “/” anywhere in the pattern, means there must be a node that matches what comes before “/”, with a child that matches what comes after “/”
Using “//” anywhere in the pattern, means it is acceptable to have multiple intermediate nodes at that point in the path (If the pattern begins with “//”, it will match every node in the DOM that conforms to the rest of the pattern)
Note:
It is more efficient if you can determine an explicit pattern that matches the intended set of nodes, rather than using the root-based form of the pattern. This is also true for embedded “//”, if the base of the search is near the top of the tree hierarchy.
To search from a node:
From the node hierarchy, select a node.
For example, in Sample_en_esm.bqy, select Rpt.DocComp [1100 Custom].
Right-click the node, and select Find From Here.
Find From Selected Node is displayed.
Enter a search pattern.
For example, enter /BQY/Root.MyDocument/Rpt.DocComp[AnnotName=’1100 Custom’].
Click OK.
The results are displayed in the Search Results pane (which opens automatically). The status bar indicates how many matches are found.