Namespace Manager
The Namespace Manager pane to the right of the main SketchPath screen is initially populated with all the namespaces and associated prefixes declared in the source XML.
(Below) StackPanel with namespace
manager shown in the midde panel.
Namespaces declared within the root element are highlighted as they have a global scope and they may not be disabled. Clicking a namespace row in the manager list will highlight the declaration within the source XML.
Default Namespace
If a default namespace is declared in the source XML, the namespace manager assigns the prefix 'def' because all namespaces must be assigned a prefix for XPath to work with the correct context.
A convenience feature is provided when editing XPath using SketchPath, where the 'def' prefix is invisibly inserted where required, so it is not mandatory to type the XPath name as: 'def:elementname' as would usually be the case.
Modifying Namespace Prefixes
It is sometimes useful to use different prefixes in XPath expressions to those declared in the source xml.
To change a namespace prefix simply type over the existing one in the Namespace manager list. The element names in the tree-view pane on the left are also changed to reflect the new prefixes whilst the source xml is unaltered. If the same source xml file is reloaded or another loaded with the same URI set, the new prefixes are preserved.
Resetting Namespace Prefixes
A 'Reset' button (see screenshort right) indicates that the prefixes in the SketchPath environmnet are different to that declared in the source XML, pressing this resets the prefix values to reflect those in the source.
Only the new prefix will be recoginized when typing XPath locations and the auto-generated XPath locations will be genered with the new prefixes too.
Screenshot of SketchPath. The Namespace Manager is the middle of the vertical panes on the right.
