20.0.0 XPath Wizard Reference
The XPath Wizard is a user interface that allows you to build XPath select statements without needing to know how to code XPath. The XPath Wizard makes it easy to navigate and select a subset of data in an XML data source. For example, instead of creating a table of all the employees in a company, you can use the Wizard to create a table of sales reps only.
This article will introduce you to the Wizard. For a detailed example that uses the Wizard, see How Do I Create a Select Statement With the XPath Wizard?
The XPath Wizard Interface
The Wizard is comprised of three panes: the Conditions Pane; the Data Pane and the Select Statement Pane.
The Conditions Pane is where you create the conditions that will be applied to the data. A condition is made up of a node, a comparison and a value. You can see those three elements labeled in the screenshot below.
- The root node is the XML node you first selected and to which the conditions you create are applied. It is good practice to select the highest node possible in order to return as much data as you need. Then you can use conditions and additional nodes to filter the data you want returned later.
- The node (or subnode) is the data you wish to satisfy a condition. In this example's data source, the node contains the employees' titles.
- The comparison is a drop-down list whose options are equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to, contains, and starts with. In this example, we chose the comparison equal to.
- The value is what the data in the node will be compared to. In this example, we chose the value "Sales Representative."
The Results Pane is a graphical view of the nodes returned by the select statement you create - it is updated in real time as you change the select statement.
Select Statement Pane
The Select Statement Pane shows the select statement created by the condition. When you click OK to close the Wizard, this is the text you will see in the Query Pane of the Tag Editor.
You may create multiple conditions within the Wizard. If you do so, the Wizard gives you the option of determining whether all or any of the conditions must be met.
Search Data Tree
To search the data tree for a node, click on "click here to add a node" to open the search window:
The search bar can be used to find nodes in your database faster. The search can be global (across the entire database), or it can be focused on a specific table within the database. To search within a specific table, locate said table and click on it (make sure its selected), then conduct the search.
- A general search will return multiple nodes. For example, if "name" is searched, the "LastName", "FirstName" and any other column that has "Name" in it's name are returned.
- If a case sensitive search is preferred, check the "Match Case" checkbox.
To cycle through the results of the search, use the down arrow button located next to the search box (or ENTER key) to go to the next column, and use the up arrow button (or SHIFT+ENTER) to cycle back through the results.
One last note – the Wizard is called the "XPath Wizard" instead of the "XML Wizard" because XPath is a query language used for finding information in an XML file. If you're new to XPath, check out the online XPath tutorial from W3Schools.