Hi,
You can do it easily by using XMLDocument and xpath query.
Below link shows how to read xml file and also how to add nodes to it.
http://www.codeguru.com/csharp/cshar....php/c9427__1/
And below link shows how to update nodes in xml file:
http://www.dotnetspider.com/kb/Article2938.aspx.
Also i would suggest you to changes structure of your xml file to the
following:
<customers>
<customer id="1">
<email>te**@test.com</email>
<email>te**@test.com</email>
</customer>
<customer id="2">
<email>te**@test.com</email>
</customer>
<customer id="3">
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
</customer>
</customers>
If you are having trouble using xpath query to retreive all the email
addresses for a specific customer (id) then please do let me know
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.
"Chris" wrote:
Hi,
I need to store customers and their emails in an XML file for quick lookup
in a small program. I am kind of a bit confused with this XML thing. Do I use
XML or this XSD Schema?
I came up with this
<customers>
<customer>
<id>1</id>
<email>te**@test.com</email>
<email>te**@test.com</email>
</customer>
<customer>
<id>2</id>
<email>te**@test.com</email>
</customer>
<customer>
<id>3</id>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
<email>te**@test.com</email>
</customer>
</customers>
Is this useable? If yes, where do I get information on reading and writing
to XML? I couldn't find any information either on searching, ex if I want to
get all the email addresses for a specific customer (id).
Thanks