In the Create New drop-down list, XML Query inserts a text or image value from an XML string. Use XML to pass in values through the OnBase API.
To create an XML Query Placeholder:
- From the Create New drop-down list, select XML Query.
-
The XML Query dialog box is displayed.
-
Enter the XPath in the Selected XPath field using one of the following methods:
-
Type the XPath in the Selected XPath field. For example, /data/listdata or /data/rowdata. Skip to step 5.
Note:The initial / in the XPath is required if the root node is not specified first in the XPath.
Note:If the XPath contains internal " "(quotation marks), the XPath must be entered into the Selected XPath field manually.
-
Click Open to select an XPath from an XML file. Continue to step 4.
-
-
Select an XML element or attribute from the XML file content pane. The Selected XPath field is populated.
If the XML file content is not displayed properly, click Format XML.
-
Click Add to XML placeholder list.
-
The Insert the result as drop-down list is displayed.
-
Select one of the following options to determine how the results of your query should be displayed:
-
Single Value- Select to insert the first value returned by the XPath query on the document.
-
Image- Select to insert the results of the query as an image. The results of the query must be encoded using Base64 encoding and must be an image format that can be inserted into a Word document.
-
List- Select to insert the results of the query as a list. All content from the top level nodes returned by the XPath query is inserted as a list embedded on the document. This Placeholder appears on the document like other Placeholders. Any list formatting that is applied to the Placeholder is used after the document is created and the values are inserted in the list.
Note:Outline formatting is not supported.
-
Table- Select to insert all the values retrieved by the XPath query as a table embedded on the document. Instances of this Placeholder appear on the document as an empty table. Any column headers entered in the top row of this table are preserved when the values are filled in. Table styles are also preserved.
-
-
The selected XPath is displayed in the XML Query Placeholders list.
To remove the selected XPath from the XML Query Placeholders list, click Delete.
-
If necessary, click Edit XPath to edit the selected XPath.
- Edit the XPath in the Selected XPath field.
-
Click Accept to accept the changes.
Click Cancel to cancel the changes.
-
If necessary, click Edit Output Style to edit the select XPath output style.
-
Depending on the previously selected output style, Edit Output Style will appear as one of the following:
Icon
Output Style
Single Value
Image
List
Table
-
The Insert the result as drop-down list is displayed.
- Select an output style.
-
Depending on the previously selected output style, Edit Output Style will appear as one of the following:
- Repeat steps 3 through 10 to create additional XML Query Placeholders.
-
In the XML Query Placeholders list, click the blue bar to collapse a selected XPath. Click the gray bar to expand a selected XPath.
To collapse all selected XPaths, click Collapse All.
To expand all selected XPaths, click Expand All.
- Click Continue.
-
The Output Style dialog box is displayed.
-
Click each selected XPath to view an output style summary and configure any additional settings.
-
Single Value has no additional settings.
-
Image has no additional settings.
-
List- If the XPath query result includes a delimiter, type this delimiter in the Delimiter (Optional) field.
For example, if the delimiter is a comma, the XML should be structured as follows:
<data><listdata>rowdata1,rowdata2,rowdata3</listdata><data>
If the XPath query result does not include a delimiter, row data must be supplied as individual elements. For example:
<data><listdata>rowdata1</listdata><listdata>rowdata2</listdata><listdata>rowdata3</listdata></data>
Note:Outline formatting is not supported.
-
Table- In the Column Names field, specify column names as a comma delimited list. These columns should be child or descendant elements to row elements. For example, column1,column2,column3. In this example, the XML would be structured as follows:
<data><rowdata><column1>data1</column1><column2>data2</column2><column3>data3</column3></rowdata></data>
When inserting values as a table, elements that are not included in the columns specified in the Column Names field are ignored. If a column is not found in a particular row, an empty cell is inserted. If necessary, columns can also be reordered.
-
- Click Finish.