Using the XPath Editor in SketchPath

SketchPath is designed to be usable immediately from launch. So once you've opened the XML Source file you need to query you can just start typing XPath.

However , there are a number of steps that can be taken to enhance the XPath editing environment to suit your needs, these are either described in this section.

Check List

  • Ensure your required XPath 1.0/2.0 version is selected (Default is controlled by user settings)
  • Make sure namespace environment is as required using namespace manager
  • If required, load the XPath library you want
  • Check XPath Variable environment has the variables group you need to access
  • If working with a large XML file and XPath editor responsiveness is poor, switch from 'Auto' to 'Pause' mode on the toolbar.
  • Set the Context Node if you're writing a relative XPath expression (For example, by double-clicking an element in the tree-view)

 

Using the Assist Pane

 The Assist Pane provides an easy way to insert XPath Functions, Axes, Node-Tests or Element or Attribute names.

Removing Last Location-Step 

Click the 'Backstep' button or press <backspace> if an item on the Assist Pane is selected.

Looking Up Variable references within the XPath Editor

Variables references are highlighted as you type. If a reference can not be resolved in the current context, a 'squiggle' underlines the reference name. To quickly check a variable reference in the XPath, selecting it, will select the node it references in the Element Tree, the XML Editor and the Element Nodes List.

 

Auto-Generating the Expression

To get things started, an expression can be auto-inserted in the XPath Editor in a number of ways:

1. Double-Click elements, attributes or nodes in the raw XML view

2. Double-Click in the Element Nodes Pane

3. Double-Click in the Variables Pane (clicking on the Name inserts $variablename, clicking on the cached value inserted the literal expression).

These expressions can then be added to or edited to meed the need.

Intellisense / Auto-Completion

The Intellisense List is populated automatically according to your the current location-path in the expression, any matches in the Intellisense list are auto-picked as you type, to accept the selected item, press the <TAB> key.

Keyboard Shortcuts

The common editing keyboard shortcuts are available for editing the XPath, namely:

Copy (Ctrl-C), Cut (Ctrl-X), Paste (Ctrl-V), Undo (Ctrl-X), Redo (Ctrl-Y), Select-All (Ctrl-A)

Navigation and selection shortcut keys such as Shift-End and Ctrl-Home are available also.

More Details

There are many XPath editing features included with SketchPath that you should discover quickly as you begin to use it, but the Getting Started guide can be a good place to get a more complete overview of this tool.