473,387 Members | 1,388 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,387 software developers and data experts.

Appending to XML files

Cat
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
Nov 16 '05 #1
2 3585

"Cat" <lo***********@yahoo.co.uk> wrote in message news:u1**************@TK2MSFTNGP09.phx.gbl...
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


I think the easiest way would be to read the file into an XmlDocument,
append the data where you want, and then write it out.
Due to the syntax of xml files you can't just "append" to the file without
violating the validity.

Hans Kesting
Nov 16 '05 #2
Cat <lo***********@yahoo.co.uk> wrote:
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..


Due to the nature of XML, you *can't* append data to an existing
(valid) document and end up with a new (valid) document - there can
only be one root element, and that *must* be closed to be a valid
document.

There are various ways of approaching the problems this causes, such as
creating many XML files which are periodically merged into a single
file containing all the same data.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

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

Similar topics

1
by: Thomas Heller | last post by:
I want to append/insert additional data to an xml file. Context: I use gccxml to parse C header files. gccxml creates an xml file containing all the definitions from the header files. The xml...
5
by: rbt | last post by:
I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's...
7
by: Don | last post by:
Hi all, With regards to the following, how do I append the datetimestamp to the filenames in the form? The files are processed using the PHP script that follows below. Thanks in advance,...
2
by: Robizzle | last post by:
I am having problems appending a number to the end of a string. I searched google and google forums and couldn't figure it out .... sorry i'm sure its simple. so I have: $filename =...
1
by: Jonathan Taylor | last post by:
I have a large XML file, that is too large to read in to XmlDocument. I need to append data to this XML file without creating a new file, since I don't want to have two copies of the large file...
16
by: Michael | last post by:
I have a data application in a2k that I need to create two fixed width text files and then combine them to a single file The first file is header information and the second is transaction data. ...
2
by: Ganesh | last post by:
Here is what I am trying to do: Open a.pdf, append b.pdf to it and save the aggregate as c.pdf. I want to do it through a program written in .net. I would like to do this without using any tools...
3
by: Donald Grove | last post by:
Is it possible to append records to a space delimited text file, using Access 2000?
4
by: John [H2O] | last post by:
I have a glob.glob search: searchstring = os.path.join('path'+'EN*') files = glob.glob(searchstring) for f in files: print f ___ This returns some files:
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.