Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
Community Member

Unable to Return a String from "Get XML Document Data" Function

I am trying to populate a Script Variable of type string "region" from the script function 'Get XML Document Data'. My XML Data is formatted like below (Also Attached):

<?xml version="1.0" encoding="ISO-8859-1" ?>


- <REGION ID="Pacific">


- <REGION ID="Central">


I need to search the XML Document for the areacode, and have the function return to me what Region that area code exists in.

Example: I do a "Get XML Document Data" where areacode=701, It should return to me region string "Central".

My Get XML Document Data step is as follows:

region = Get XML Document Data (XMLRegions, ":/REGIONS/REGION[AREACODE=areacode]")

I also have tried:

region = Get XML Document Data (XMLRegions, "/descendant::REGIONS/child::REGION[AREACODE='" + RareaCode + "']")

I specified RareaCode as a string variable to see if it didn't work because the XML name was the same as my variable. When I changed it to the above code, it returns to me: U"\n\t\t" instead of null....

region is a type string script variable

areacode is a type string script variable that is set by the callerID to the area code of the caller

When I run through the debug, it just returns null.

I have attached the script and the XML Document. The section of the script with this specific lookup starts after the Welcome Label, and ends before the GeneralQ label.

Any help or guidance would be great. Thanks.

Community Member

Re: Unable to Return a String from "Get XML Document Data" Funct

I used the following:

XML file:




XML Path: /descedant::REGIONS/child::REGION[attribute::areacode="495"]/child::CITY

CreatePlease to create content