473,385 Members | 1,908 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.

XMlSerialization - Append to existing object

RJN
Hi

I'm using XMlSerailizer to write certain content to file. If the file
exists, I'm supposed to append the xml to the file.

eg.,

<EmployeeList>
<Employee></Employee>
</EmployeeList>

Assume when serializing for the first time, I get an xml like the above.
When I further serialize employee records when the application is run
next time, I'm supposed to append it to the list of employees that
already exist. If I use streamwriter to append the file, it writes after
the closing tag of EmployeeList. One way is to deserialize the existing
xml, then add the new employees into this object and then again
serialize. But this will be a huge overhead. Is there better way of
doing this?

Regards

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Apr 10 '06 #1
0 1084

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

Similar topics

0
by: Omkar Singh | last post by:
I have a problem while using XmlSerialization. XmlSerializaion creates a lot of 'href' and namespaces while serializing a complex object. Can we control serialization to stop href and namespaces. ...
2
by: Nico Grubert | last post by:
Hi there, I would like to open an existing file that contains some lines of text in order to append a new line at the end of the content. My first try was: >>> f = open('/tmp/myfile', 'w')...
25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
1
by: sam | last post by:
Hi Doesn't seem like XMLSerialization serializes Shared properties. My vb.net class has a load of properties, only two of which are marked as Shared. When I serialize it to XML, all the...
2
by: STom | last post by:
I have just started reading up on XMLSerialization and still do not understand the practical use of this technology. For example, if I have to know the class type on the client and on the web...
2
by: JMCN | last post by:
hi i have a general question regarding append queries in access 97. each week i need to update my table(tblonlinereg) with new or modified records. firstly, i import the text file into my...
4
by: MN | last post by:
I have to import a tab-delimited text file daily into Access through a macro. All of the data needs to be added to an existing table. Some of the data already exists but may be updated by the...
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>
42
by: Armin | last post by:
Hi, just a dumb question. Let a = Why is the value of a.append(7) equal None and not ?? --Armin
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: 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
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.