Edit online

XPath Expression Results View

When you run an XPath expression, Oxygen JSON Editor displays the results of its execution in the Results view.

This view contains the following columns:
  • Description - The result thatOxygen JSON Editor 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. To group the results by their resource, or by their system ID, right-click the header of any column in the Results view and select Group by "Resource" or Group by "System ID". If no information regarding location is available, Oxygen JSON Editor displays Not available in the Location column. Oxygen JSON Editor displays the results in a valid XPath expression format.
- /node[value]/node[value]/node[value] -

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 JSON Editor 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 1. XPath Results Highlighted in Editor Panel with Character Precision