473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Appending XML to an existing XML file

Hey all, I've read a few articles about speed and XML processing - so I just
want to make sure that I'm using the right strategy for what I want to
achieve.

I have an XML file that I'm appending to every time a user submits their
information.

Right now I'm using XMLDocument (Load and Save) in conjuncture with
XmlElement objects.

Is this the right approach or is there a faster approach?

Thanks,
Novice

PS Here is a simplified version of what I'm doing:
XmlDocument xdoc = new XmlDocument();
xdoc.Load("results.xml");
XmlNode node = xdoc.SelectSingleNode("//TopNode");
XmlElement newNode = xdoc.CreateElement("UserInput");
newNode.InnerText = Request.Params("SomeInputID");
node.AppendChild(newNode);
xdoc.Save("results.xml");

Nov 12 '05 #1
1 4213
Novice wrote:
Hey all, I've read a few articles about speed and XML processing - so I just
want to make sure that I'm using the right strategy for what I want to
achieve.

I have an XML file that I'm appending to every time a user submits their
information.

Right now I'm using XMLDocument (Load and Save) in conjuncture with
XmlElement objects.


You can get much better perf using XML fragment instead of XML document
here. See http://www.tkachenko.com/blog/archives/000053.html

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: PC Datasheet | last post by:
Looking for suggestions ---- A database was designed for a national automobile inspection program. In it's simplest form, the database has two tables: TblOwner OwnerID <Year/Make/Model owned...
2
by: Cat | last post by:
How do you go about appending data from a dataset to an existing xml file? I know you can use WriteXML but this writes over any data already existing in the specified file.. Cat
1
by: onemonk | last post by:
hi guys... I hav this problem, I am planning to write html form values to xml file and... the problem is... When I am entering data... its recording only the latest entry.. by overwriting the...
3
by: Jim | last post by:
Could anyone please point me towards some code that allows me to add to an existing XML file using the output of an HTML form. I want to add a form on my website so users can input their email...
4
by: Jules48 | last post by:
I store comprehensive details of customers' "transactions" in Access (2000). At the moment, I (or my staff) duplicate entry of the information in an Excel spreadsheet which we use to extract stats...
1
by: Frank | last post by:
Hi, Let's say I have a file named myFile.xml Within that file I have blocks of data which I'd like to add at different times during the day. e.g. <LogEntry>
1
by: ofuuzo1 | last post by:
Hei, I am having issue using DOM to appending a new xml file (new.xml) to another existing xml file (old.xml) without deleting the existing items in old.xml. I would like to have the new...
1
by: ofuuzo1 | last post by:
Hi, Is there anyway I can append a new element to an existing xml without first loading the existing file into a variable, adding the new element into the variable and saving it by overwriting the...
0
by: ghafarifar | last post by:
How I appending a new node to am existing xml file? help?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.