So I want to organize my xml files in UCCX so that I can call parent data or sibling/peer data from the child of the parent. This makes it much easier to format xml files so that they easier to read and also more useful.
Lets take the following:
<settings>
<queue name="potatoes">
<number>1234</number>
<queue name="bacon">
<number>5678</number>
</settings>
Say you know the number and need to get the name of the queue. I've seen a couple very convoluted ways to do this by looping through the xml file many times. There is an easier way. Say you are calling the bacon queue by dialing extension 5678. How can you get bacon? Check it out:
"/settings/queue/number['5678']/../@name"
This returns "bacon" because ../ gets the parent. As you may see, this makes XML files much, much easier and valuable.
So of course let's make this a little more useful and make a String variable, DNIS, and assign it the value 5678. Watch out for the single and double quotes. The script editor uses a horrific font which makes it very very hard to see what is actually typed in.
"/settings/queue/number['" + DNIS + "']/../@name"
This also returns bacon. As all things should.