Load html to rich text field

Avatar

Avatar

pmcastro

Avatar

pmcastro

pmcastro

05-06-2020

Hello

In my xdp form I have a text field (named Comments) setting to rich text format. 

I receive a xml file , and in the Comments field of the xml I have html tags like <br/> or <b></b>.

 

How can I load the xml file correctly to the xdp field in order to keep the text well formatted?

Further, how can I send the less than signal (<) in that xml?

 

Many tanks

Pedro

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Anudeep_Garnepudi

Avatar

Anudeep_Garnepudi

Anudeep_Garnepudi

30-10-2020

Hi @pmcastro 

Use the below methods to escape and unescape HTML and XML string based on need.

  • org.apache.commons.lang3.StringEscapeUtils.escapeHtml4(String input)
  • org.apache.commons.lang3.StringEscapeUtils.unescapeHtml4(String input)
  • org.apache.commons.lang3.StringEscapeUtils.escapeXml(String input)
  • org.apache.commons.lang3.StringEscapeUtils.unescapeXml(String input)

Hope this helps.

AG

Answers (1)

Answers (1)

Avatar

Avatar

vanegi

Employee

Avatar

vanegi

Employee

vanegi
Employee

13-07-2020

Please see the discussion here in this post https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-html-tags-i... This may be helpful.