Expand my Community achievements bar.

SOLVED

AEM 6 XML rendering with Sightly

Avatar

Level 5

When creating a Sightly page component, we are unable to find out how to name the file inside the component so that it overrides the XML rendition of the component. 

We can't use the usual xml.jsp, since this is a Sightly component.  Oddly, if I put an xml.jsp in my Sightly component, it takes effect, but I can't put Sightly code in there, as it won't render.

Any help is appreciated.

Thanks,

-Dean Anderson

1 Accepted Solution

Avatar

Correct answer by
Level 8

Create an xml.html file and have it output your XML.  As long as you're using <sly> tags or "data-sly-unwrap" and you're outputting valid XML, it will definitely work.  We've accomplished this exact thing with both JSON and XML.

View solution in original post

2 Replies

Avatar

Level 10

"When using  Sling, the type of content to be rendered is not the first processing consideration. Instead the main consideration is whether the URL resolves to a content object for which a script can then be found to perform the rendering. "

Taken from the AEM Docs here: 

https://docs.adobe.com/docs/en/cq/5-6-1/developing/the_basics.html

Sightly will not render XML unless of course you program it to do so. If you want to render XML, you need XML script. 

Avatar

Correct answer by
Level 8

Create an xml.html file and have it output your XML.  As long as you're using <sly> tags or "data-sly-unwrap" and you're outputting valid XML, it will definitely work.  We've accomplished this exact thing with both JSON and XML.