The XPath expressions can be quickly edited and executed using the XPath toolbar. The content completion support shows documentation for all the XPath 1.0, 2.0 and 3.0 functions. The function signature tooltip presented above the current function indicates the names and types of the edited arguments.
This view allows editing of multi-line, complex expressions, assisting you with features like content completion, syntax highlight, automatic validation and documentation of the currently edited item. The executed expressions are stored in a history list and they can be reused as necessary.
XPath expressions can be executed over multiple files. You can choose one of the predefined scopes (current file, entire project, a selection from the project, all open files, DITA Map hierarchy) or define your own collection of files (a so-called working set). Scope selection is available both in the XPath/XQuery Builder view and in the XPath toolbar.
You can choose to execute XPath expressions over all XML files from the selected scope but you can also define patterns to filter out certain files.
The results of an XPath query are shown as a list in the results panel. You can save the results to a file by clicking the Save Results option from the right-click menu or even print the XPath results. Clicking on a result line will highlight the corresponding part from the document.
Results are returned in a format that itself is a valid XPath expression: - [FileName.xml] /node[value]/node[value]/node[value] -
If your project is comprised of a main file with ENTITY references to other files, you can use XPath to return all the elements matching a certain criteria by querying the main file. The result list will include results from all referenced files, providing a simple way of access to the nodes of the document.
The XPath expressions are evaluated from the current element so relative expressions can be evaluated in different contexts.