Highlighted

Dynamic table with strange XML

Avatar

Avatar

Piotr_Stapp

Avatar

Piotr_Stapp

Piotr_Stapp

12-10-2008

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.

Replies

Highlighted

Avatar

14-10-2008

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.