Read xml file and convert it to aem page | Community
Skip to main content
rk39193348
New Participant
October 1, 2020
Solved

Read xml file and convert it to aem page

  • October 1, 2020
  • 4 replies
  • 7813 views

Hi all,

 

I have a requirement where I need to read xml file and convert it to aem page. Is there a way to do it?

 

Regards,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Ravi_Pampana
Ravi_PampanaAccepted solution
New Participant
October 1, 2020
rk39193348
New Participant
October 2, 2020
Thanks for your reply. The article mentioned by you stores xml in JCR, which I have achieved, how can I convert it to html page?
BrianKasingli
New Participant
October 1, 2020

@rk39193348,

Here's how I would do it.

  1. Upload the XML into AEM. The XML should either be a section of your website (including with all it's children)
  2. Create an OSGI service or servlet, Java Backend, to execute the migration logic. (somehow referencing to the XML file)
  3. Implement the migration logic with the Uber Jar AEM libraries such as the PageManager API or the JCR API to clone/create page and edit pages... of course you will need to parse the XML.

 

Manjunath_K
New Participant
October 1, 2020

@rk39193348 

There are two options available.

 

1. Import XML data by scheduler, store it in UGC & use that data on the page based on your requirement.

2. Say storing it in UGC not required, then you can skip saving it in UGC & create page whenever scheduler runs using the xml data.

 

refer this blog to import & store xml data in UGC.

https://aem.redquark.org/2019/05/import-xml-data-into-aem.html

 

rk39193348
New Participant
October 2, 2020
Thanks for your reply. The article mentioned by you stores xml in jcr, which I have achieved, how can I convert it to html page?
santhosh_kumark
New Participant
October 1, 2020

Hi @rk39193348 ,

 

First we need to write OSGI service to read data and persist key value properties in CRX repo using JCR API's and once the XML data is available in JCR node properties, we can access and display it on any page.

 

Regards,

Santosh

 

 

rk39193348
New Participant
October 1, 2020
Thanks for your reply. I want to convert xml to page, how can that be achieved?