Expand my Community achievements bar.

We are excited to introduce our latest innovation to enhance the Adobe Campaign user experience — the Adobe Campaign v8 Web User Interface!
SOLVED

Adobe Web App Rendering Issue (<em> tags showing)

Avatar

Level 2

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>&lt;EmailTemplateContent ItemId=&amp;quot;{CEF3701C-4BF0-4B03-BCF1-C87CDE3EBAC5}&amp;quot; ItemName=&amp;quot;default&amp;quot;&gt;

  &lt;Header&gt;Preview your &amp;lt;em&amp;gt;Iberian Voyage: Lisbon to Barcelona&amp;lt;/em&amp;gt; itinerary in this video&lt;/Header&gt;

"

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(/&quot;/g, '\"'); rawXmlData = rawXmlData.replace(/&rdquo;/g, '\"'); rawXmlData = rawXmlData.replace(/&ldquo;/g, '\"'); rawXmlData = rawXmlData.replace(/&rsquo;/g, "\'"); rawXmlData = rawXmlData.replace(/&lsquo;/g, "\'"); rawXmlData = rawXmlData.replace(/&hellip;/g, "..."); var xmlData = new XML(rawXmlData); %>

<%= xmlData.Header %>

I've tried using xmlData.Header.toString().replace(/&amp;lt;em&amp;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 &lt; and &gt;. Or it's being converted back.

Any help would be greatly appreciated!

Jim

1 Accepted Solution

Avatar

Correct answer by
Level 2

Okay, so I found a solution. Use a document.write of the XML node resolves the issue.

View solution in original post

3 Replies

Avatar

Level 10

Hi Jim,

Have you tried with other tags than <em> to see if the problem persists?

Let me know,

Florent.

Avatar

Level 2

Hi Florent,

I have tried to replace just the "&lt;" and "&gt;" 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

Avatar

Correct answer by
Level 2

Okay, so I found a solution. Use a document.write of the XML node resolves the issue.