Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
4

AEM 6.5 xml file generation with attributes of each element

New Here ,
Aug 20, 2023 Aug 20, 2023

I am working on a dynamic form and using AEM 6.5 to build it. I have an export data button that when clicked, exports the data saved in the form to an xml with its corresponding elements. To be more precise, I have the following for exporting:

 

xfa.host.exportData("",0);

 

The generated xml file looks like the following. It has the elements tags and any value stored in the corresponding textfield, or checkbox, etc. 

 

<?xml version="1.0" encoding="UTF-8"?>
<root>

<ApplicationType>

<ATRadioButton100>1</ATRadioButton100>

<ATRadioButton050>1</ATRadioButton050>

<ADTextField170>345-908-7888</ADTextField170>

<ADTextField190>Engineer</ADTextField190>

..

..

 

What I would like to do is that when the xml is generated, it also includes an attribute for each element. For example:

 

<ADTextField170 name="phone">345-908-7888</ADTextField170>

 

Is it possible in AEM to set attributes for each object (e.g. textfield, radiobutton) that are then listed as part of the xml which is generated using the exportData function. If not, is there any other way to create an xml that contains data plus attribute(s) of each element. The reason being is that this way our clients will know what each element (textfield, radiobutton, checkbox, dropdown) variable is for by looking at its name attribute.  

 

Sajjad267644286znm_0-1692551459508.png

 

Thank you in advance.

180
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines