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

Serialize XML - adding on an existing xml file!

Hi there,

I had this tutorial from Microsoft site:

http://support.microsoft.com/default...b;en-us;815813

I had 1 question.

Just say i already serialize a xml file. But next time, i want to add on to the xml file, under the particular xml node.

How can i do that? I do not want to overwrite anything? Just add in the xml tags.

Just say i had 100 records, i add on another 100, it will become 200 records in the xml file.

Any tips for me please? Thanks.
--
Regards,
Chua Wen Ching :)
Nov 16 '05 #1
3 3945
Having the condition that you don't want to overwrite anything it's obvious,
that under the assumption that what you have in the file is a wellformed XML
document, this is not feasible.
Best regards,

Henrik Dahl

"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:9F**********************************@microsof t.com...
Hi there,

I had this tutorial from Microsoft site:

http://support.microsoft.com/default...b;en-us;815813

I had 1 question.

Just say i already serialize a xml file. But next time, i want to add on to the xml file, under the particular xml node.
How can i do that? I do not want to overwrite anything? Just add in the xml tags.
Just say i had 100 records, i add on another 100, it will become 200 records in the xml file.
Any tips for me please? Thanks.
--
Regards,
Chua Wen Ching :)

Nov 16 '05 #2
Hi Henrik Dahl,

Oops. I mean i prefer to append the new xml elements into the existing one, and not overwritting the whole document with the new tags.

Thanks.
--
Regards,
Chua Wen Ching :)
"Henrik Dahl" wrote:
Having the condition that you don't want to overwrite anything it's obvious,
that under the assumption that what you have in the file is a wellformed XML
document, this is not feasible.
Best regards,

Henrik Dahl

"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:9F**********************************@microsof t.com...
Hi there,

I had this tutorial from Microsoft site:

http://support.microsoft.com/default...b;en-us;815813

I had 1 question.

Just say i already serialize a xml file. But next time, i want to add on

to the xml file, under the particular xml node.

How can i do that? I do not want to overwrite anything? Just add in the

xml tags.

Just say i had 100 records, i add on another 100, it will become 200

records in the xml file.

Any tips for me please? Thanks.
--
Regards,
Chua Wen Ching :)


Nov 16 '05 #3
You may just seek to just before the end tag of the document element and
then write your stuff and then a new end tag. Please observe that doing such
stuff is basically a matter of doing some lower abstraction level things so
you're a bit on your own, i.e. not backed up by any higher order XML related
tools.
Best regards,

Henrik Dahl

"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:25**********************************@microsof t.com...
Hi Henrik Dahl,

Oops. I mean i prefer to append the new xml elements into the existing one, and not overwritting the whole document with the new tags.
Thanks.
--
Regards,
Chua Wen Ching :)
"Henrik Dahl" wrote:
Having the condition that you don't want to overwrite anything it's obvious, that under the assumption that what you have in the file is a wellformed XML document, this is not feasible.
Best regards,

Henrik Dahl

"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:9F**********************************@microsof t.com...
Hi there,

I had this tutorial from Microsoft site:

http://support.microsoft.com/default...b;en-us;815813

I had 1 question.

Just say i already serialize a xml file. But next time, i want to add
on to the xml file, under the particular xml node.

How can i do that? I do not want to overwrite anything? Just add in
the xml tags.

Just say i had 100 records, i add on another 100, it will become 200

records in the xml file.

Any tips for me please? Thanks.
--
Regards,
Chua Wen Ching :)


Nov 16 '05 #4

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

Similar topics

2
by: Jim Cobban | last post by:
I must be missing something. I am using org.apache.xml.serialize.XMLSerializer to save a DOM but I am not getting non-basic characters converted to UTF-8. I create Text nodes in the DOM by,...
3
by: Jim Cobban | last post by:
I must be missing something. I am using org.apache.xml.serialize.XMLSerializer to save a DOM but I am not getting non-basic characters converted to UTF-8. I create Text nodes in the DOM by,...
7
by: Ian Tompsett | last post by:
H I was wondering if it possible for an object to serialize/deserialize itself from XML. I'd be guessing that it would need to use the XmlSerializer class, but that seems to want to create a...
7
by: titanandrews | last post by:
Hi All, There is a library for Java called XStream which will serialize instances to XML. It's very easy to use and does not require changing existing code. Basically, you just call 1 API method...
14
by: vince | last post by:
Can I add (append) to an xml file that already contains a serialized object, and be able to deserialize to either or both objects from the same file...??? How is this done...?? thanks, vince
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
7
by: Ben Amada | last post by:
I've created a class that I need to store in ViewState. However when I try to store it in ViewState, I get the following error: "The type 'solution.pe2' must be marked as Serializable or have a...
2
by: =?Utf-8?B?TW91dGhPZk1hZG5lc3M=?= | last post by:
How can I add an MD5 hash to XMLSerializer.Serialize without corrupting the content of the file; then how to read it back to verify is correct? I'd like to code up something (see below) that...
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: 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
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:
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
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.