Pattern matching in UCCX XML ?

Unanswered Question
Jul 25th, 2010

Hi friends,

Can I using pattern matching in UCCX XML? When some person from A site call to contact center, A script will check prefix of calling number to match data in XML or not?


<?xml version="1.0" encoding="ISO-8859-1"?>
    <NUMBER prefix="201">
        <NAME>Site A</NAME>
    <NUMBER prefix="202">
        <NAME>Site B</NAME>


If calling number is 2019999 how to write script and XML path to check only 3 digit from calling number in XML file. Anyone can sugguest solution about this issue? Please help!

Thanks you for every comment.


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Jonathan Schulenberg Mon, 07/26/2010 - 05:09

Yes you can do this. The first thing to do is strip off the first three digits so you can use that for the XPath query. The easiest way to do this is with the .substring() method and assign the resulting value to a new variable. Once you have the three-digit string that you want to search for, use that in an XPath statement of a Get XML Document Data step. Your XPath query would look like this: "/SITE/NUMBER[@prefix='" + callerPrefix + "']/NAME"  Note that the attribute value you want is contained withing single quotes which are passed to the XML parser after the Get XML Document Data step concatinates the strings together and inserts the variable value at runtime.

Natee Osatis Mon, 07/26/2010 - 19:14

Dear Jonathan,

     Thanks you for you advise, May I ask more question about .substring() method.

          1. .substring() is applied in variable at Expression Editor?

          2. How to write .substring() in UCCX? It can write this method same as java? Could you share example?

Thanks you,


Jonathan Schulenberg Tue, 07/27/2010 - 04:44

Generally speaking, the entire script is Java with a pretty UI layed on top of it. Most Java expressions/coding rules apply. In the more basic versions you have to be careful how advanced you get because you do not have a "Java license" and certain things can throw an exception.

Anyways, for .substring() you could just use it in a Set step for simplicity. Set callerPrefix = callingNumber.substring(1,3).  You may need to play with those integer values; I can never remember the char selection rules for this method.


This Discussion