Using FreeMarker (in NetSuite EFT templates), I'm ...
# ask-stanley-ai
m
Using FreeMarker (in NetSuite EFT templates), I'm getting the following issue: this row: <Nm>reuteler & cie SA</Nm> is being printed out as: <Nm>reuteler & cie SA</Nm> What can I do?
c
AI generated answer (using internal Slack threads):
It seems like you're having an issue with special characters in your FreeMarker template. This is a common issue when dealing with XML and HTML entities in text strings. One way to handle this is to use the
?replace
function in FreeMarker. This function replaces all occurrences of a substring within the string. In your case, you can use it to replace '&' with '&'. Here's how you can do it:
Copy code
freemarker
${yourString?replace("&", "&")}
This will replace all occurrences of '&' in
yourString
with '&'. However, please note that this is a simple solution and might not cover all special characters that could potentially be in your text. If you have other special characters in your text, you might need to handle them separately. Another approach is to use
?xml
built-in in FreeMarker which escapes the string for XML. This will handle '&', '<', '>', '"' and ''' (apostrophe). Here's how you can do it:
Copy code
freemarker
${yourString?xml}
This will escape all special characters in
yourString
for XML. Please note that the version of FreeMarker used by NetSuite is 2.3.26-incubating, so make sure to check the FreeMarker documentation for this version to see what functions are available. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835762143
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829611242
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826677561
Please provide your feedback on this answer.