" /> Parse XML string in routing strategy - Genesys CTI User Forum

Author Topic: Parse XML string in routing strategy  (Read 3632 times)

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline Mikael Jansson

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Parse XML string in routing strategy
« on: September 25, 2009, 07:53:36 AM »
Advertisement
Hi !
In ounr email enviromment we get a sting in "xml-format".

Ex:
<TechnicalHeader><Reply-to></Reply-to><CustomerId></CustomerId><MailItemId></MailItemId><ActionCode>FORWARD</ActionCode><UserID></UserID><ChannelId></ChannelId></TechnicalHeader>

What I need to do is to update the key <ActionCode>.(ex change  FORWARD to REPLY).
Dont't find any function in Sting maipulation to do this in a good way.

Using routing 7.6.

Anyone got any ideas.

Regards Mikael

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Parse XML string in routing strategy
« Reply #1 on: September 25, 2009, 08:29:50 AM »
Hi Mikael,

As you know there are no functions related to XML available in IRD. If you need just change value of one parameter then I would use StrReplace function (StrReplace[<variable>,'<ActionCode>FORWARD</ActionCode>','<ActionCode>REPLY</ActionCode>']). I know it isn't "elegant" solution but it should work. if you don't know initial value of the key "ActionCode" then you would need to do some string parsing (using IRD functions StrChar and StrSub).

R.

Offline BenTaylor

  • Full Member
  • ***
  • Posts: 107
  • Karma: 4
Re: Parse XML string in routing strategy
« Reply #2 on: September 25, 2009, 09:53:57 AM »
I think it would be best to write your own subroutine to do this. As René says, you're going to have to use the string manipulation functions to make it work.

Offline Mikael Jansson

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Re: Parse XML string in routing strategy
« Reply #3 on: September 25, 2009, 10:05:24 AM »
Thanks, hpofylle somewhere in the future this would be included now when we have soap in the system this will be more and more used i guess.
I will post my solution here soon.
/ Micke

Marked as best answer by cavagnaro on June 21, 2023, 01:10:10 AM

Offline Mikael Jansson

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Re: Parse XML string in routing strategy
« Reply #4 on: September 25, 2009, 10:50:09 AM »
Hi !
Here comes my solution, it's not pretty but it does the job.  ;)

It's a strategy that will be converted to a subroutine that takes teh xml-sting, tag to be updated and value.

Regards
Micke