Hi,
I have a web app that queries our business tables to returns XML. Here's a sample of what's displayed in the "enable debug mode":
"
<ctx lang="en" _folderModel="" origin="neolane" webApp-id="64953510" _target="web" date="2017-07-07T19:33:35Z" _console="1" score="0">
<userInfo timezone="America/New_York" theme="" orgUnitId="0" noConsoleCnx="true" loginId="3319" loginCS="Web applications agent (webapp)" locale="en-US" instanceLocale="en-US" homeDir="" datakitInDatabase="true">
<login-right right="admin" />
</userInfo>
<timezone changed="false" current="America/New_York" />
<Tbl_ProductTemplate _key="@id" _operation="update" id="195670" TemplateContentType="trip-highlights">
<EmailTemplateContentXML><EmailTemplateContent ItemId=&quot;{CEF3701C-4BF0-4B03-BCF1-C87CDE3EBAC5}&quot; ItemName=&quot;default&quot;>
<Header>Preview your &lt;em&gt;Iberian Voyage: Lisbon to Barcelona&lt;/em&gt; itinerary in this video</Header>
"
in the page element, I have the following to prepare and render the <Header> content:
<% var rawXmlData = ctx.Tbl_ProductTemplate.EmailTemplateContentXML;
rawXmlData = rawXmlData.toString(); rawXmlData = rawXmlData.replace(/"/g, '\"'); rawXmlData = rawXmlData.replace(/”/g, '\"'); rawXmlData = rawXmlData.replace(/“/g, '\"'); rawXmlData = rawXmlData.replace(/’/g, "\'"); rawXmlData = rawXmlData.replace(/‘/g, "\'"); rawXmlData = rawXmlData.replace(/…/g, "..."); var xmlData = new XML(rawXmlData); %>
<%= xmlData.Header %>
I've tried using xmlData.Header.toString().replace(/&lt;em&gt;/ig, '<em>') to convert the html entities back to characters so the web app will render the header correctly, but the header continue to render as <em>#########</em>. It seems like the replace is bypassing the < and >. Or it's being converted back.
Any help would be greatly appreciated!
Jim
Solved! Go to Solution.
Views
Replies
Total Likes
Okay, so I found a solution. Use a document.write of the XML node resolves the issue.
Views
Replies
Total Likes
Hi Jim,
Have you tried with other tags than <em> to see if the problem persists?
Let me know,
Florent.
Views
Replies
Total Likes
Hi Florent,
I have tried to replace just the "<" and ">" to "<" and ">" without any success. But I was able to replace other letters, outside of the tags, e.g., changing the letter "a" to "A", Barcelona to BArcelonA.
Thanks,
JIm
Views
Replies
Total Likes
Okay, so I found a solution. Use a document.write of the XML node resolves the issue.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies