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

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
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
Have you tried this Victor?
Avatar of Victor  Charles

ASKER

Hi Fernando,

I will get back to you tonight.

Thank you.

Victor
Hi,

It works!

Thank You.

Victor