would anyone know a more thorough way of making a ...
# suitescript
u
would anyone know a more thorough way of making a string more xml-friendly? using the N/xml module's
escape()
function doesn't seem to return a string that escapes apostrophes. It's managed to escape everything else, including ampersands'. for context i'm rendering a pdf using
Render.xmlToPdf()
. If it helps, the xml isn't loaded from File Cabinet, but rather hard-coded onto the script itself as a string via backticks, and the values added through placeholders.
b
Copy code
require(['N/xml'], function(xml) {
  log.debug(xml.escape({xmlText: '\''}))
})
works as expected
although freemarker has its own escape mechanisms
1
u
thanks for the freemarker reference, that seems to have worked for my case.