I am attempting to dereference the following XML object:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<IVRAuthenticationContext>
<class>com.spiekerpoint.spider.api.IVRAuthenticationContext</class>
<clientAdministratorId/>
<name>Sam Electrician</name>
<workerId>3</workerId>
</IVRAuthenticationContext>
Code: Select all
function getElementText(document, tag) {
element = document.getElementsByTagName(tag).item(0);
if (element) {
contentNodes = element.childNodes
textNode = contentNodes.firstChild
if (textNode) {
return(textNode.nodeValue)
}
}
}
Referencing the function above with the following:
Code: Select all
<assign name="workerId" expr="getElementText(context,'workerId')" />