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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Dynamic table with strange XML

Avatar

Level 2
Probably I should write my problem before, instead of asking "part-questions".<br /><br />I have an XML like this:<br /><Root><br /> <Elem1 value="ss"><br /> <Elem2 value="ss2"><br /> <ElemInTable1 value="s" index="0"><br /> <ElemInTable2 value="s" index="0"><br /> <ElemInTable1 value="s" index="1"><br /> <ElemInTable2 value="s" index="1"><br /></Root><br /><br />Explanation: <br />Elements: <br />a) ElemX are normal fields. <br />b) ElemInTableX are elements which represent a table. All elements with the same attribute index are in the same row.<br /><br />I am trying to create a form which will allow me to have an dynamic table (adding and deleting rows), which will fill both attributes ('value' and 'index'). <br />I am out of ideas who to bind fields to textfields, or how to "repair" XML with javascript. Still something does not work correctly.
1 Reply

Avatar

Not applicable
Hello,<br />you have to change your XML to smth like this:<br /><br /><?xml version="1.0" encoding="iso-8859-1"?><br /><root> <br /> <Elem1 value="ss"/> <br /> <Elem2 value="ss2"/> <br /> <table1><br /> <ElemInTable1 value="s" index="0"/> <br /> <ElemInTable1 value="s" index="1"/> <br /> </table1> <br /> <br /> <table2><br /> <ElemInTable2 value="s" index="0"/> <br /> <ElemInTable2 value="s" index="1"/> <br /></table2><br /> <br /></root><br /><br />and make this file as source for DataConnection.<br /><br />After that you will be able to bind tables and add instances.