Metadata files have a bunch of information about the connection properties, file's path, and more depending on the type of Metadata.
To access those information and use it dynamically, a language called XPath can be used, which is standard language allowing to browse XML file data (which is how Metadata files are stored in background.)
Depending on the technology on which you are working, we added a bunch of dedicated XPath custom functions which allows to retrieve various information.
This article explains how to see and find the XPath expressions available on a Metadata node.
Prerequisites:
- Stambia DI Designer S20.5.0 or higher
XPath Expressions Wizard
The XPath Expressions wizard allows to easily find the XPath expressions to generate.
This wizard is available from a right click on a Metadata node, under the XPath entry:
Search XPath Expressions
When opening this wizard, a popup opens to search and tests XPath expressions on the currently selected node.
XPath expressions list is available on the popup and the list is sorted alphabetically.
The displayed list is the "XPath Expressions" available for the selected node and the "Global XPath Expressions" which are available on all the nodes of the Metadata.
Two ways are available to search and select the XPath expressions to test.
The first one is simply to look at the list and find the corresponding expression for the given node:
The second one is simply to use the search bar which is in the wizard:
XPath expression result
XPath expressions are evaluated at generation, which means when generating the target packages / deliveries.
However, this wizard allows to simulate the generation and see the result of an XPath expression.
For this, in the wizard, simply double click on an Expression, the wizard will then simulate the generation and produce the result of the expression in the Console View.
Changing the current focus without closing the wizard
The wizard shows the XPath expressions available on the Metadata node on which it has been launched from.
However, you can change the current focus to see the XPath expressions available on other Metadata Nodes without having to close and reopen the wizard.
For this, simply click on the corresponding button, and then on the Metadata node on which you want to focus.
The wizard will change its focus and show the XPath expression of the other Metadata nodes you clicked on:
Multiple XPath expressions search
Note that you can also open multiple instances of the XPath Expression wizard in your Designer, if you need to, to perform any search as you want: