I want to be able to extract some values within the tags of an XML string. I am trying to achieve this by copying the contents of the XML file onto the Clipboard, using GetClipBoard to place the string into a variable and trying to use XMLParse to extract the value TG0508I10-SOV. (<reqresp:CustomerReference>TG0508I10-SOV</reqresp:CustomerReference>)
Unfortunately I have not been able to work out how to do this successfully. If some kind sould could assist, I would greatly appreciate it.
My Macro code is below and the XML string is below that:
Code: Select all
GetClipBoard>XMLString
StringReplace>XMLString,soapenv:,,XMLString
StringReplace>XMLString,reqresp:,,XMLString
Let>tmp0=Envelope/Body/CustomerReference/text()
XMLParse>XMLString,tmp0,CustomerReference,numBooks
msg>%CustomerReference%
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/ ... xt-1.0.xsd"/>
</soapenv:Header>
<soapenv:Body>
<reqresp:RequestResponseResponse xmlns:reqresp="http://somewhere.co.nz/folder/msggate/reqresp/v1">
<reqresp:CustomerReference>TG0508I10-SOV</reqresp:CustomerReference>
<reqresp:MailboxMsgId>5997</reqresp:MailboxMsgId>
<reqresp:DocumentSize>2130</reqresp:DocumentSize>
<reqresp:ReceivedDate>2016-08-05 16:48:56.269</reqresp:ReceivedDate>
<reqresp:ReqStatus>OK</reqresp:ReqStatus>
<reqresp:AckStatus>OK</reqresp:AckStatus>
</reqresp:RequestResponseResponse>
<mesa:attachment href="cid:attachment=-[email protected]" xmlns:mesa="http://www.sterlingcommerce.com/mesa"/>
</soapenv:Body>
</soapenv:Envelope>