AnsweredAssumed Answered

Parse XML response from doSelect

Question asked by ElwynnMartin on Jul 11, 2018
Latest reply on Nov 9, 2018 by ElwynnMartin

I'm wondering if it's possible to parse the poorly formed XML with the doSelectReturn below?

 

<doSelectResponse xmlns="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
<doSelectReturn xmlns="">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;UDSObjectList&gt;
&lt;UDSObject&gt;
&lt;Handle&gt;cnt:B89C91520C3C2044A3F07140A8F91CF8&lt;/Handle&gt;
&lt;Attributes&gt;
&lt;Attribute DataType="2002"&gt;
&lt;AttrName&gt;last_name&lt;/AttrName&gt;
&lt;AttrValue&gt;Communications&lt;/AttrValue&gt;
&lt;/Attribute&gt;
&lt;/Attributes&gt;
&lt;/UDSObject&gt;
&lt;/UDSObjectList&gt;
</doSelectReturn>
</doSelectResponse>

 

I've tried using the applyXPath operator and I can get it to parse the doSelectResponse and give me the doSelectReturn but I can't get it to return any values within the doSelectReturn. I assume this behavior is due to poorly formed xml because once i replaced &lt; and &gt with < and > i could get an online parser to give me the values.

I tried to do the same thing with JavaScript in PAM   .....replace(/&lt;/g, '<').replace(/&gt;/g, '>'); but I still couldn't get PAM to return any values.

 

Is there another way to parse this xml within PAM that I'm not aware of?

 

Elwynn.

Outcomes