The Problem

Increasingly complex XML structures mean that XPath locations get lengthier and take more time to complete, the auto-generation features of SketchPath would normally be the route to take to get a first rough XPath location. However, in a single instance of a node sub-tree in the source it may not be possible to see all the possible locations and take into account the effect of predicates, especially when they are nested.

Flash movie of auto-completion in action

Auto-Completion using the Assist Pane

The Auto-Completion functionality, remedies the problem described above. It does this by performing 'look-ahead' queries whenever a location path is valid in the incomplete expression. The Assist Pane provides the features necessary to help in the building of an XPath expression. One of the most useful features is the Intelli-List which is populated with all the named child-elements, attributes, variables or even values that are in the context of the XPath expression that is being edited.

The screen shot above shows the Intelli-List populated with all available attributes as that selected by the 'Trace Mode cursor.

Intelli-List Features

Nested Predicates and Function calls

The node list is populated according to the sub-context at the point where the expression is being typed. Therefore, the list is populated correctly even if the sub-context is nested several times within predicates, or within function calls.

XPath Variable Context

XPath variables are also taken as part of the sub-context for populating the node list, either as location paths or values, determined by their position.

Expression Context

The node list is populated when typing even if on the right side of an expression or sub-expression (within a predicate).

Auto-Completing Literal Values

The list of nodes available in the source XML is extended to include available values whenever the <space> bar is pressed after an 'equals'  = symbol. Value nodes are identified by being enclosed within single quotes.

Context-Sensitive appending or replacement

The Intelli-List behaviour on selecting an item adapts according to the state of the expression. When the contents of the Intelli-List is colored red, last expression item will be replaced if a list item is selected, otherwise the selected list item will be appended to the expression.