Load html to rich text field

Avatar

Avatar
Validate 1
Level 1
pmcastro
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
pmcastro
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
pmcastro
Level 1

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
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

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
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
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.