Load html to rich text field | Community
Skip to main content
June 5, 2020
Solved

Load html to rich text field

  • June 5, 2020
  • 2 replies
  • 1722 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Anudeep_Garnepudi

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

2 replies

vanegi
Adobe Employee
Adobe Employee
July 13, 2020
Anudeep_Garnepudi
Community Advisor
Anudeep_GarnepudiCommunity AdvisorAccepted solution
Community Advisor
October 30, 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