Victor Charles
asked on
Help with adding data element is a specific row of an xml file using VB.NET
Hi,
How do I add a data element in a specific row of an xml file using VB.NET? for example if I have File1.xml file listed below how od I add Zip Code under the Location data element to obtain File2.xml?
File1.xml
<Root>
<Table1>
<ID>1</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>2</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>3</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
</Root>
File2.xml
<Root>
<Table1>
<ID>1</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Zip Code></Zip Code>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>2</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Zip Code></Zip Code>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>3</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Zip Code></Zip Code>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
</Root>
Thanks,
Victor
How do I add a data element in a specific row of an xml file using VB.NET? for example if I have File1.xml file listed below how od I add Zip Code under the Location data element to obtain File2.xml?
File1.xml
<Root>
<Table1>
<ID>1</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>2</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>3</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
</Root>
File2.xml
<Root>
<Table1>
<ID>1</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Zip Code></Zip Code>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>2</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Zip Code></Zip Code>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
<Table1>
<ID>3</>
<Name></Name>
<Address> </Address>
<Location></Location>
<Zip Code></Zip Code>
<Occupation></Occupation>
<Hobbies></Hobbies>
<Religion></Religion>
</Table1>
</Root>
Thanks,
Victor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you tried this Victor?
ASKER
Hi Fernando,
I will get back to you tonight.
Thank you.
Victor
I will get back to you tonight.
Thank you.
Victor
ASKER
Hi,
It works!
Thank You.
Victor
It works!
Thank You.
Victor