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

Unanswered Question
Dec 29th, 2008

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.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Borkes1985 Sun, 01/11/2009 - 00:59

I used the following:

XML file:

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




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


This Discussion