Hi, I.m using nlapiStringToXML() API for parsing S...
# suitescript
s
Hi, I.m using nlapiStringToXML() API for parsing String to XML (XML response) but getting null as an output, Can anyone have any idea?
b
are you sure the output is null, or are you not used to how the xml logs
s
[#document: null] getting like that
b
thats not null
and its how the top level document looks like if you log it
s
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:eft="http://services.innervation.co.za/EFT" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenvHeader/&gt;&lt;soapenvBody><efteftNetworkRes&gt;&lt;Time&gt;1315:57</Time><Date>2021-05-20</Date><STAN>215922</STAN><EchoData>edvvvdchfvfddo m111e</EchoData><ResponseCode>00</ResponseCode><NWReqType>301</NWReqType></efteftNetworkRes&gt;&lt;/soapenvBody></soapenv:Envelope>
that is the response
b
hopefully you are hiding information, what you shared is invalid xml due to the missing namespaces
s
Now check once
b
looks good now
the output is not null
has all the methods you would expect on a DOM document
and works with the usual navigation methods using nlapiSelectNode
s
nlapiSelectNode(responseXML,'/soapenvEnvelope/soapenvBody');
b
though you will suffer since there is no binding namespace in xpaths
s
I tried with that, again I'm getting null as an output
b
expect to use the local-name when working with namespaces
s
any referral documents, please can you send me
b