This document describes how to define a variable name in the XML path to extract XML data with the Extract XML Document Data step in an IP Contact Center (IPCC) Express environment.
Readers of this document should have knowledge of these topics:
Cisco Customer Response Solutions (CRS)
Cisco CRS Editor
The information in this document is based on these software and hardware versions:
Cisco CRS version 3.x and later
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Refer to the Cisco Technical Tips Conventions for more information on document conventions.
Use the Extract XML Document Data step after the Create XML Document step to find data from a document formatted with XML. Figure 1 represents the step sequence.
Note: This only serves as an example.
Figure 1—Sequence of Extracting XML Document Data
Complete these steps to use the Extract XML Document customized window in order to obtain data, as Figure 2shows:
Select the variable that stores the data from the Result Data drop-down menu.
Enter the XML path directly or take one of these actions in the XML Path field:
Choose the XML path from the XML Path drop-down menu.
Click Expression Editor.
Type an expression that specifies the XML path.
Select the variable that stores the source document from the Document drop-down menu.
Click OK.
The Extract XML Document Data only applies to a document created by the Create XML Document step. Otherwise, errors occur.
You must execute a separate Extract XML Document Data step for each field in the XML file.
If the XML document contains the content in this output, you need to configure the Expression Editor for the Extract XML Document Data step as Figure 3 shows in order to extract the value of the Last node. The exact XML path is indicated by the A arrow. The B arrow points to the location where the XML path should be entered.
Figure 3—Expression Editor - Extract XML Document Step<?xml version="1.0" standalone="yes"?> <STOCKLIST> <STOCK symbol="MSFT" error="0"> <HIGH>58.0625</HIGH> <PCT_CHANGE>0.67114094</PCT_CHANGE> <LOW>55.1875</LOW> <LAST>56.25</LAST> <CHANGE>0.375</CHANGE> <VOLUME>31,973,600</VOLUME> <REC_STATUS>0</REC_STATUS> <DATE>02/21/2001</DATE> <TIME>15:52</TIME> </STOCK> </STOCKLIST>
Complete these steps if MSFT is specified as a variable name of the symbol in the XML path:
Define X as a string variable.
Set X = "MSFT"
Specify the XML path value in the Extract XML Document Data step to:
"/descendant::STOCKLIST/child::STOCK[attribute::symbol='" + X + "']/child::LAST"
When you compare the XML path in Figure 3, MSFT is replaced by + X + in the XML path by this method.