07-28-2011 06:45 AM - edited 03-14-2019 08:17 AM
Does anyone have a XML area code script that I can look at?
08-17-2011 06:32 PM
I'm not sure what else I can do for you. I have given you sample code that works, and all you have to do is take it and run with it.
08-19-2011 07:48 AM
Here's what i'm getting.
08-22-2011 08:18 AM
From that screen shot it would appear that either:
A) you haven;t given the script an XML file to load
B) the XML file you gave the script is not valid XML
Can you confirm both? PS you can validate your XML at validator.w3.org
08-22-2011 11:07 PM
Hi Anthony,
I think you deserve a +5 for all the tips you wrote in this thread.
Gabriel
08-23-2011 07:21 AM
Thanks Gabriel!
08-19-2011 07:43 AM
Anthony,
Great example on the Area Code XML Script. I am new to scripting. Could you provide direction or clarification of the following set strings. I am buiding a E164 script not just area code. I am trying to understand substring(0, 3) and the set xpath configuration..
area_code = calling_number.substring(0, 3)
set xpath = "//AreaCodes[AreaCode=" + area_code + "]/../@value"
If you can provide input it would be much appreciated.
Regards
08-22-2011 07:44 AM
String.subtring(0, 3) is a method that returns a section of a String.
The first number, 0, is the starting index of the string, and the second number, 3, is how many characters to the right to return.
Example: "6125551212".substring(0, 3) would return "612". "6" being index 0, and "612" being 3 characters long.
Now for the XPATH, are you asking how the variables and Strings are put together, or how XPATH works?
set xpath = "//AreaCodes[AreaCode=" + area_code + "]/../@value"
After this is evaluated, the xpath variable should look like this:
"//AreaCodes[AreaCode=612]/../@value"
In XPATH terms, that means:
Find an AreaCodes node, which has an AreaCode child node with a value of 612, and then get the original AreaCodes node's attribute "value".
For more on XPATH, here is a good reference:
01-30-2012 10:21 AM
Solution to my question
https://supportforums.cisco.com/thread/2128707?tstart=0
Anthony,
Customer has standard license.
This does not work with standard license
area_code = calling_number.substring(0, 3)
Is there another method that will give me the first 3 digits of the calling number?
Thanks,
Solomon
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide