XPath Designer

XPath Designer allows you to test an XPath expression against a selected XML file.

The result of the query evaluation is displayed in the table bottom of the table.

Option Description
Sample XML Select an XML file by clicking . The file will be displayed in the area below the field.
The component does not open too big XML files in XPath Designer. The limit is 80000 symbols.
Field/File name Specify the name of the field that will be used for RRT generation or the name of the file that will be created using the query result.
RRTs should not be used in the Field name text box, since the entered name is used for building RRTs for the subsequent components.
Namespace prefix If namespaces are used in the XML file and you are going to create an XPath query to receive an element or attribute belonging to a particular namespace, you should specify the namespace prefix in this text box. For example, if your XML file contains the following specification: xmlns:bk='urn:loc.gov:books' and you are going to use an XPath query //bk:title that refers to the <bk:title> element, you should enter bk in this text box.
Namespace URI If namespaces are used in the XML file and you are going to create an XPath query to receive an element or attribute belonging to a particular namespace, you should specify the namespace URI in this text box. For example, if your XML file contains the following specification: xmlns:bk='urn:loc.gov:books' and you are going to use an XPath query //bk:title that refers to the <bk:title> element, you should enter urn:loc.gov:books in this text box.
XPath query Enter an XPath query in this field. For example, the expression book[@type="Fiction"] refers to the <book> elements whose type attribute is set to Fiction. See more examples of the XPath queries in the description of the component usage.
Test Click this button to test the XPath query. The component will execute the XPath query on the selected XML file and display the result set in the Result values table.
Result values This table displays the results of the XPath query execution. The XPath query result can be either the search fields, which will be used for building RRTs (when this dialog box is opened from the Add New/Edit Search Field dialog box), or the files passed to the subsequent components in the workflow (when this dialog box is opened from the Add/Edit File dialog box).

If this dialog box is used for getting search fields, and the XPath query returns several results, the component creates indexed RRTs for the query’s result set and one non-indexed RRT for the first value. For example, if an XPath query returns a result set containing three values of Invoice Number, the following four RRTs will be created:

  • ~XIM::%Invoice Number%~
  • ~XIM::%Invoice Number_1%~ (contains the same value as the first non-indexed RRT above)
  • ~XIM::%Invoice Number_2%~
  • ~XIM::%Invoice Number_3%~
For a single output, non-indexed RRT will be created: ~XIM::%Invoice Number%~.

If this dialog box is used for getting files, and the XPath query returns several results, several files will be sent to the subsequent components in workflow. The index will be added to the second and the next file names. For example, if you specify the file name as Image.tif, and the XPath query returns 2 results, the following 2 files will be sent to the subsequent components:

  • Image.tif
  • Image_1.tif

If the result value is too long to be displayed in the Result values table, click on it to see the whole value in a pop-up window.