Guest

Cisco Unified Contact Center Express

Extract XML Data with the Extract XML Document Data Step

Cisco - Extract XML Data with the Extract XML Document Data Step

Document ID: 63530

Updated: Jan 26, 2005

   Print

Introduction

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.

Prerequisites

Requirements

Readers of this document should have knowledge of these topics:

  • Cisco Customer Response Solutions (CRS)

  • Cisco CRS Editor

Components Used

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.

Conventions

Refer to the Cisco Technical Tips Conventions for more information on document conventions.

Background

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

extrct-xml-data-1.gif

Complete these steps to use the Extract XML Document customized window in order to obtain data, as Figure 2shows:

  1. Select the variable that stores the data from the Result Data drop-down menu.

  2. 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.

    Figure 2—Extract XML Document Data

    extrct-xml-data-2.gif

  3. Select the variable that stores the source document from the Document drop-down menu.

  4. 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.

Solution

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.

<?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>
Figure 3—Expression Editor - Extract XML Document Step

extrct-xml-data-3.gif

Complete these steps if MSFT is specified as a variable name of the symbol in the XML path:

  1. Define X as a string variable.

  2. Set X = "MSFT"

  3. 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.

Related Information

Updated: Jan 26, 2005
Document ID: 63530