Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Load html to rich text field

pmcastro
Level 1
Level 1

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

1 Accepted Solution
Anudeep_Garnepudi
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post

0 Replies
Anudeep_Garnepudi
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post