10-17-2022 05:53 AM
Hello
I want to have a UCCX script that checks an XML file and using XPATH I can get somw information (in this case the name)
This is the XML
<Mobile-Numbers>
<employees>
<num>1234567890</num>
<name>John Smit</name>
</employees>
</Mobile-Numbers>
The XPATH would be: /Mobile-Numbers/employees[num="1234567890"]/name to get the name
But in the XML document each person requires two lines (<num> and <name>)
Is it not possible to have the number and the name on one line?
Thanks
JH
10-17-2022 07:00 AM
The easiest path will be to get this in two steps, one per line. Another method would be to change your XML format and collapse both fields together. Finally, the last one is to create a custom Java to do this, but that's way too much effort.
david
10-18-2022 01:46 AM
Thank you for your reply
I am not an XML expert, how would you collaps both fields together? Can you give an example using the above XML?
Thanks you!
JH
10-28-2022 03:18 AM
These have helped me over the years:
10-18-2022 05:46 AM
It could look something like this:
<Mobile-Numbers>
<employees>
<num>1234567890 John Smit</num>
</employees>
</Mobile-Numbers>
Then you have to split the num from the name. Honestly, I would just do this in two steps to get each field. That's your fastest way forward.
david
10-29-2022 07:02 AM
Thank you all
In the end with some searching I have now this:
<Mobile-Numbers>
<employees>
<num id="1111111111">TEXT1</num>
<num id="2222222222">TEXT2</num>
<num id="3333333333">TEXT3</num>
</employees>
</Mobile-Numbers>
"//num[@id='"+ CallingNumber +"' ]"
And this works for me. I only need one variable (the TEXT) if you need more variables, then this is not workinmgh I believe
JH
10-29-2022 03:19 PM
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