Screenshot of SketchPath in 'Manager' mode
Storage
SketchPath provides for the storage of XPath expressions, either within the current session or to an XPath Library file. The XPath library can be reloaded from file at any time.
XPath Expressions Metadata in the Library
The environment stores a range of additional information related to each expression as it is saved. The comment field is initially populated with the Source XML filename, comments can be added to from the XPath Manager.
The details stored with each XPath expression are shown in the 'Expression Manager' pane and is illustrated above. The description of each column is given below:
(i) The XPath variable name by which the saved XPath can be referred to
(ii) ($) If the XPath expression is 'marked' and should be available to be referenced as a variable
(iii) The group that the XPath variable is a member of
(iv A cached value for the XPath variable
(v) The context node that was set when the XPath was run
(vi) The name of the active source XML file open when the XPath was run (inserted as a comment)
Managing groups of Expressions in Expression Manager
Expression Manager has a dedicated toolbar that lets you move items quickly between groups, or more them into and out of a 'recycle bin'. The Expression Manager Pane is most effective when used in combination with the 'Variables Pane', this is effectively a filtered view of expressions for a single group which is selected from the 'Group' drop-down list. Only those items in a group that are 'marked' are visible in the Variables Pane.
The toolbar helps to, in a single action, move large number of items that are 'marked' (that is those that are checked in the column with the '$' header).
Marking Items
Multiple Item Marking
To assist in marking items, there are four key functions available from the Expression Manager Tool Bar: 'Mark All', 'Un-Mark All', 'Invert Marks', 'Mark Group' and 'Un-Mark Group'. To mark or unmark groups, select the required group first, either from the Expression Grid or from the drop down list in the Variables List.
Single Item Marking
Expression items can be marked/unmarked individually by clicking the check box in the '$' column of the Expression manager.
Selecting A Group
The group functions rely on a group being pre-selected, this can either be done from the Expression manager pane, by clicking on a group cell, or by selecting a group from the drop-down list in the Variables Pane.
Moving Marked Items
A group must be selected as the 'target' of a move. Once all the items to be moved have been marked, click the 'Move to Group' button. The Variables Pane will show the new values in its list.
The Recycle Bin
The Recycle Bin can be managed the same as any other group, moving marked items, into and out of it. Its only special feature is that it always exists (even when empty) and that its contents can be cleared using the 'Clear Bin' button. Note that the contents of the Recycle Bin (if it hasn't been cleared) are saved when you save the expression library file.
Changing values in Expression Manager
The Name, $, Group and Comment field values can be modified inside the Expression manager, by selecting the item and making the change. The Expression, Cached Value and Context Menu fields are protected.
Referencing Variables in XPath Expressions
XSLT variables, (names preceded by '$' in expressions) are colorized in the XPath Editor as they are recognized within an XPath expression. They are underlined with a 'squiggle line' if they are not in the current XPath environment. To be in the XPath environment a variable must be visible in the 'Variables Pane', so it must both be marked and be in the same group as that selected in the 'group' drop-down list of the 'Variables Pane'.
Note that the cached values are refreshed whenever 'Reload Source XML' is selected

