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

Possible to execute Sightly Parsing on a String returned by a service?

kharris3
Level 1
Level 1

I'm looking to see if it is possible to get a string of HTML from a service and execute the sightly parser on that string. We have a service layer that returns HTML and I'd like to be able to have sightly markup within that HTML for processing. For example using i18n ${'key', @i18n}.

I've tried wrapping the HTML returned in a sightly template and then calling it within my sightly component but unfortunately it did not work.

1 Accepted Solution
smacdonald2008
Correct answer by
Level 10
Level 10

The best practice to handle DOM parsing when writing a Sightly component is to have the Java logic (part of the Sightly component) handle the parsing.

You can use a Java API to handle the logic - such as JSOUP API. Sighly is for displaying data - not for manipulating data like DOM parsing. It way better to handle that on the Java side. 

See this community article: 

https://helpx.adobe.com/experience-manager/using/domparser.html

Hope this helps you. 

View solution in original post

2 Replies
smacdonald2008
Correct answer by
Level 10
Level 10

The best practice to handle DOM parsing when writing a Sightly component is to have the Java logic (part of the Sightly component) handle the parsing.

You can use a Java API to handle the logic - such as JSOUP API. Sighly is for displaying data - not for manipulating data like DOM parsing. It way better to handle that on the Java side. 

See this community article: 

https://helpx.adobe.com/experience-manager/using/domparser.html

Hope this helps you. 

View solution in original post

kharris3
Level 1
Level 1

Thanks, that's pretty much what I figured as well, was just hoping to leverage what was already there. Appreciate the input.