Altova StyleVision 2025 Enterprise Edition

Edit XPath Expression Dialog

Home Prev Top Next

The Edit XPath Expression dialog (screenshot below) is used to build, test, and edit XPath expressions. It is accessible at all places in Design View where an XPath expression may be entered, such as when entering expressions for conditional processing or the values of Styles and Properties.

 

The dialog automatically supports the XPath version that corresponds to the XSLT version of the SPS (XPath 1.0 for XSLT 1.0; XPath 2.0 for XSLT 2.0; and XPath 3.1 for XSLT 3.0). To switch the XPath version, switch the XSLT version of the SPS.

 

Dialog layout

The Edit XPath Expression dialog contains the following panes (see screenshot below): (i) an Expression pane (top left); (ii) a Sources pane (top right); (iii) a Results pane (bottom). In Builder Mode, the Results pane is augmented by additional entry helper panes.

DlgEditXPExp01

 

Evaluation Mode and Debug Mode

The Edit XPath Expression dialog has two modes:

 

Evaluation Mode, in which an XPath expression is evaluated with respect to the assigned Working XML File/s. The expression is entered in the Expression pane, and the result is displayed in the Results pane. You can click nodes in the result to go to that node in the Sources pane of the dialog.

Debug Mode, in which you can debug an XPath expression as it applies to the assigned Working XML File/s. You can set breakpoints and tracepoints, and go step-by-step through the evaluation. At each step you can see the content of variables, as well as set custom Watch expressions to check additional aspects of the evaluation.

 

To switch between the two modes, select the appropriate command in the Start Evaluation/Debugging dropdown menu that is located in the left-hand corner of the window's toolbar (see screenshot below).

XPXQWindowSelectEvalMode

How to use the two modes is described in the sub-sections of this section.

 

XPath/XQuery Expression Builder

In both modes, the Expression Builder can be used to help you construct syntactically correct expressions. Switch Expression Builder on/off with the Builder Mode button of the main toolbar icSwitchToExpBuilder.

 

© 2018-2024 Altova GmbH