By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

Edit XML File

P: n/a
BiT
Hello

I Know how to create and add elements to xml file with XmlTextWriter, here
is code for example:
Dim textWriter As XmlTextWriter = New XmlTextWriter("table.xml", Nothing)

' Opens the document

textWriter.WriteStartDocument()

' Write comments

textWriter.WriteComment("Database")

' Write first element

textWriter.WriteStartElement("R_DataBase")

textWriter.WriteString("test")

textWriter.WriteEndElement()

' Ends the document.

textWriter.WriteEndDocument()

' close writer

textWriter.Close()

I Would like to know if there's way to edit xml file i mean to open the file
and then to add or remove elements from it. beacuse right now my program
make a new xml file everytime i need to save the file

May 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
BiT wrote:
I Would like to know if there's way to edit xml file i mean to open the
file and then to add or remove elements from it. beacuse right now my
program make a new xml file everytime i need to save the file
You can use System.Xml.XmlDocument to load the XML document into a DOM
tree model where you are then able to add/delete/manipulate nodes and
save the tree model back to a file.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.