Searching from Selected Nodes

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:

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:

  1. From the node hierarchy, select a node.

    For example, in Sample_en_esm.bqy, select Rpt.DocComp [1100 Custom].

  2. Right-click the node, and select Find From Here.

    Find From Selected Node is displayed.

  3. Enter a search pattern.

    For example, enter /BQY/Root.MyDocument/Rpt.DocComp[AnnotName=’1100 Custom’].

  4. Click OK.

    The results are displayed in the Search Results pane (which opens automatically). The status bar indicates how many matches are found.