But when trying to assign that value I only get da...
# suitescript
i
But when trying to assign that value I only get data, without the tags, I tried parsing it using
JSON.stringify
but didn’t work, any idea, what I want to do is get some values from that xml so I though about using
nlapiStringToXML
but I got an error saying
Copy code
Content is not allowed in prolog
This is what I tried :
nlapiStringToXML(JSON.stringify(xmlLookup.custrecord_bit_file_content))
b
Copy code
Content is not allowed in prolog
your error suggests that you aren't passing xml to be parsed
xmlLookup.custrecord_bit_file_content
is a javascript string, so when you stringify it, your code stringifies a string
thats not xml, it probably ends up looking like
Copy code
\"<?xml version=\\\"1.0\\\"?>\\n<CTPcanonicalInvoicev001>\\n  <Coverpage>\\n    <Uuid>20191203110619388</Uuid>\\n....\"
i
Yes, you are right, I was trying to use `nlapiStringToXML`just to have better access, but using `slice()`directly on the string gave me the same result!! Thanks @battk!!