XPath Expression Results View

When you run an XPath expression, Oxygen XML Developer plugin displays the results of its execution in the XPath Results view.

This view contains the following columns:
  • Description - The result thatOxygen XML Developer plugin displays when you run an XPath expression.
  • XPath location - The path to the matched node.
  • Resource - The name of the document that you run the XPath expression on.
  • System ID - The path to the document itself.
  • Location - The location of the result in the document.
To arrange the results depending on a column, click its header. If no information regarding location is available, Oxygen XML Developer plugin displays Not available in the Location column. Oxygen XML Developer plugin displays the results in a valid XPath expression format.
- /node[value]/node[value]/node[value] -

XPath Results View Contextual Menu Actions

The following actions are available when the contextual menu is invoked in this view:

Select All
Extends the selection to all the messages from the view.
Copy
Copies information associated with the selected messages in case you want to paste it elsewhere.
Save Results
Saves the complete list of messages in a file in text format. For each message, the included details are the same as the ones for the Copy action.
Save Results as XML
Saves the complete list of messages in a file in XML format. For each message, the included details are the same as the ones for the Copy action.
Save Results as HTML
Saves the complete list of messages in a file in HTML format. For each message, the included details are the same as the ones for the Copy action.

Example:

The following snippets are taken from a DocBook book based on the DocBook XML DTD. The book contains a number of chapters. To return all the chapter nodes of the book, enter //chapter in the XPath expression field and press (Enter). This action returns all the chapter nodes of the DocBook book in the Results View. Click a record in the Results View to locate and highlight its corresponding chapter element and all its children nodes in the document you are editing.

To find all example nodes contained in the sect2 nodes of a DocBook XML document, use the following XPath expression: //chapter/sect1/sect2/example. Oxygen XML Developer plugin adds a result in the Results View for each example node found in any sect2 node.

For example, if the result of the above XPath expression is:
- /chapter[1]/sect1[3]/sect2[7]/example[1]

it means that in the edited file, the example node is located in the first chapter, third section level one, seventh section level 2.

Figure: XPath Results Highlighted in Editor Panel with Character Precision