Altova XMLSpy 2025 Professional Edition

XPath/XQuery Expressions

Home Prev Top Next

XPath and XQuery expressions are used to navigate XML trees. With the addition of support for maps and arrays in version 3.1, XPath and XQuery expressions of version 3.1 can also be used to navigate JSON structures. XPath is a subset of XQuery, and any expression that is valid in both languages will return the same result in both languages. For more information about the two languages, see the XPath 3.1 Recommendation and XQuery 3.1 Recommendation.

 

Evaluating XPath/XQuery expressions in XMLSpy

XMLSpy provides powerful features to build XPath/XQuery expressions, and to evaluate and debug expressions against XML and JSON documents. This enables you to quickly build and test expressions against the XML or JSON documents on which you plan to use them.

 

These analytic features are available in the XPath/XQuery Window,  which is is an output window located by default among the other output windows at the bottom of the application interface. The features of the XPath/XQuery Window are described in the sub-sections of this section.

 

In a typical user scenario, you would do the following:

 

1.Open the XML or JSON document for which you want to build or evaluate an expression.

2.Enter the XPath/XQuery expression in the XPath/XQuery Window.

3.Run the Evaluator or Debugger to see the results. The Evaluator shows the end result, whereas the Debugger enables you to go step-by-step through the evaluation process, showing you aspects of the result at each step.

 

In this section

This section describes the features of the XPath/XQuery Window. It is organized as follows:

 

About the XPath/XQuery Window

Evaluate Mode: for evaluating XPath/XQuery expressions

Debug Mode: for debugging XPath/XQuery expressions

Expression Builder: for building XPath/XQuery expressions

XQuery Expressions for JSON

Points to Note

 

© 2018-2024 Altova GmbH