tony leake wrote:
I need to store records in xml files, i need to load the
record, add new nodes, delete nodes and modify existing ones then
save the file again.
Looks to me like there are different ways of working with xml,
xml file writer and xml documents. Which method is most suitable
to what i want to do?
Use System.Xml.XmlDocument to load the XML into a DOM tree structure,
then you can manipulate the tree structure (CreateElement,
AppendChild/InsertBefore/InsertAfter to insert elements, RemoveChild to
delete, InnerText to modify) and save the changes back using the Save
method.
Another way the .NET framework offers is XML deserialization and
serialization, that way you define .NET classes with public properties
that map to XML elements or attributes and you do not work with an XML
tree structure but rather with .NET objects and .NET types.
See <http://msdn2.microsoft.com/en-us/library/2bcctyt8(VS.80).aspxfor
an overview and introduction, if you need concrete help after reading
that then post examples of the XML you want to manipulate and we can
show you some code snippet.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/