Expand my Community achievements bar.

SOLVED

Generate XML using Sightly

Avatar

Level 2

Hi,

I would like to use Sightly to generate XML and properly XML escape the text. So what I would like to do is

<myTag>${properties.text @context='xml'}</myTag>

but this does not seem to be possible.

I have seen that in Sightly one has access to some Java backed objects like 'xssAPI'. So now I would like to use the method xssAPI.encodeForXML but I do not see how I could call this method in Sightly.

Any help how to do xml escaping in sightly is appreciated.

Thanks,
Ronald

1 Accepted Solution

Avatar

Correct answer by
Level 10

With Slighty - you can pass operations to Java. You can easily create XML using Java and various Java APIs like W3C APIs. To learn how to work with Sighty and Java, see:

http://helpx.adobe.com/experience-manager/using/creating-sightly-component.html

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

With Slighty - you can pass operations to Java. You can easily create XML using Java and various Java APIs like W3C APIs. To learn how to work with Sighty and Java, see:

http://helpx.adobe.com/experience-manager/using/creating-sightly-component.html