Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 6th, 2007, 11:34 PM
Authorized User
Join Date: Jul 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Append Information to a XML file

Is there anyway to append nodes and data to a already existing XMl file? i can create the file and add information at the same time i create it but how do add information to it after the XML file has been created?

Old May 7th, 2007, 03:09 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

One way is to use the AppendChild method of the XmlDocument. Open the existing file, use CreateElement/CreateNode to create the node and add any required data. The use AppendChild(NewNode) to add the new element to the file. Then save the file, overwriting the existing copy.


Joe (Microsoft MVP - XML)
Old July 26th, 2007, 02:15 PM
Authorized User
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts

Joe: I was wondering if there is a way to append a child node to an existing XML file which is as big as 50 - 100mb, without loading the whole file into memory?

Similar Threads
Thread Thread Starter Forum Replies Last Post
append a xml node from one file to another pravind XSLT 5 August 22nd, 2009 09:15 AM
append/insert data to xml file andhiez XML 5 April 18th, 2008 11:13 AM
append in xml file rapraj XML 3 October 11th, 2007 02:58 AM
append data to xml andhiez General .NET 0 June 14th, 2005 04:15 AM
Append a textfile information to a variable Helmut Classic ASP Professional 1 July 16th, 2003 08:23 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.