Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with appending multiple data element from File2.xml to file1.xml

Hi,

Hi,


If file1.xml contains data in Part A in file contains data in Part B. How do append the data from file2 to file 1 and save it as file3.xml?

Part A:

<Root>
<Table1>
<SN>10411</SN>
<NSC>ITEMA</NSC>
</Table1>
<Table1>
<SN>10412</SN>
<NSC>ITEMB</NSC>
</Table1>
<Table1>
<SN>10421</SN>
<NSC>ITEMC</NSC>
</Table1>
<Table1>
<SN>10521</SN>
<NSC>ITEMD</NSC>
</Table1>
<Table1>
<SN>10611</SN>
<NSC>ITEME</NSC>
</Table1>
</Root>


Part B:

<Root>
<Table2>
<RIC><RIC>
<NOP></NOP>
<FIF><FIF>
</Table2>
</Root>

Desired Solution:

File3.xml

<Root>
<Table1>
<SN>10411</SN>
<NSC>ITEMA</NSC>
<RIC><RIC>
<NOP></NOP>
<FIF><FIF>
</Table1>
<Table1>
<SN>10412</SN>
<NSC>ITEMB</NSC>
<RIC><RIC>
<NOP></NOP>
<FIF><FIF>
</Table1>
<Table1>
<SN>10421</SN>
<NSC>ITEMC</NSC>
<RIC><RIC>
<NOP></NOP>
<FIF><FIF>
</Table1>
<Table1>
<SN>10521</SN>
<NSC>ITEMD</NSC>
<RIC><RIC>
<NOP></NOP>
<FIF><FIF>
</Table1>
<Table1>
<SN>10611</SN>
<NSC>ITEME</NSC>
<RIC><RIC>
<NOP></NOP>
<FIF><FIF>
</Table1>
</Root>

Thanks,

Victor
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi Victor;

In your example you change the parent node Table2 to Table1 and add that as the first child node under the root node, is that what you want?

In the Part B is the parent node always going to be Table2 and in Part A will it always be Table1?
Avatar of Victor  Charles

ASKER

Hi,

Yes to both of your questions. The table names are not very important just using thoses as examples, will use different ones in my project. Many goal is to append the data from file2.xml to all the records in file1.xml.

Thanks,

Victor
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

On my way home, will test it as soon as I get home and get back to you.

Thanks,

Victor
Hi,

It works.

Thanks,

Victor
Not a problem Victor, glad to help.