473,800 Members | 2,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML Serializing one object in a collection

sam
I have a collection of vb.net objects with LoadXML and SaveXML functions
which use XML serialization to persist the collection.

Is it possible to Update one single object in the collection at a time? Can
I have a SaveXML function on my objects that will persist the object to a
specific node in the collection's xml? Rather than having to overwrite the
entire file when I only want to update one object node.

Sorry if I'm not being clear enough, it's difficult to describe.

Thanks

Sam
Nov 11 '05 #1
2 2768
I don't think there is an easy way to update the middle of an XML file
programmaticall y without saving the entire file again using just XML centric
APIs. Perhaps using the classes in the System.IO namespace but then that may
not be a trivial affair depending on how complex the edits you are trying to
make are.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"sam" <IN*****@NOSPAM .com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I have a collection of vb.net objects with LoadXML and SaveXML functions
which use XML serialization to persist the collection.

Is it possible to Update one single object in the collection at a time? Can I have a SaveXML function on my objects that will persist the object to a
specific node in the collection's xml? Rather than having to overwrite the
entire file when I only want to update one object node.

Sorry if I'm not being clear enough, it's difficult to describe.

Thanks

Sam

Nov 11 '05 #2
Thanks, you put the issues better than I did. I think I'm gonna look into
doing it using XPath

thanks again

sam

"SQL Server Development Team" <sq****@microso ft.com> wrote in message
news:em******** *****@TK2MSFTNG P12.phx.gbl...
I don't think there is an easy way to update the middle of an XML file
programmaticall y without saving the entire file again using just XML centric APIs. Perhaps using the classes in the System.IO namespace but then that may not be a trivial affair depending on how complex the edits you are trying to make are.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"sam" <IN*****@NOSPAM .com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I have a collection of vb.net objects with LoadXML and SaveXML functions
which use XML serialization to persist the collection.

Is it possible to Update one single object in the collection at a time?

Can
I have a SaveXML function on my objects that will persist the object to a specific node in the collection's xml? Rather than having to overwrite the entire file when I only want to update one object node.

Sorry if I'm not being clear enough, it's difficult to describe.

Thanks

Sam


Nov 11 '05 #3

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

Similar topics

5
6904
by: Jeff Bunting | last post by:
I'm trying to serialize a class I have and have been getting: An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll There was an error reflecting type MyClass. I noticed in the help for the SerializableAttribute Class the following: "Indicates that a class can be serialized. This class cannot be inherited." The class I'm trying to serialize is not inherited itself, but does inherit
1
1688
by: dotNetDave | last post by:
I'm trying to create xml seriaizable collection class (below), but the xml keeps coming out wrong. In the resulting xml from the web service (below) the "ArrayOfAlarmProcessor" tag should really be "Processors" and the "AlarmProcessor" tag should be "Processor". <ArrayOfAlarmProcessor xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://mycompany/webservice/NetworkAlarms">...
1
2890
by: Carl Gilbert | last post by:
Hi I am trying to serialize a collection of GUIDs by overriding the serialize function on a diagram component I am using. The following code sucessfully serializes a single GUID: Public Overloads Overrides Function Serialize(ByVal Key As Object) As String Dim objXML As New XmlDocument Dim objParent As XmlElement
3
2618
by: Amy L. | last post by:
I am using the xml serializer to serialize the objects out of a collection into a file. The object that is being serialized is a class in my application. When I serialize my class it produces the following line. <?xml version="1.0" encoding="utf-16"?> for each instance of my serialized class. Thus giving me the following output.
0
1628
by: JackRazz | last post by:
I'm trying to serialize a collection to a file stream by serializing each object individually. The code below works fine with the BinaryFormatter, but the SoapFormatter reads the first object and just goes to the end of the file. After reading the first object, the fStream.Position is pointed to the end of the file. The collection serializes/deserilizes fine when I just serialize the hashtable vs. each object in the hashtable. Does...
0
1454
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and the 2nd property is a strongly typed collection class (myCollectionProperty). The collection contains a simple class (myCustomClass) which has 1 text property (TextProperty).
3
6877
by: axr | last post by:
Having trouble with Serilization of objects that contain members which are of type Interface eg public class SomeClass { ISomeInterface1 itf1; ClassType1 ct1; ISomeInterface2 itf2;
1
1240
by: falcon198198 | last post by:
Greetings: I was hoping for some advice on an application. Here is what I am working on: Basically I have a bigger application that is having a printing problem making multiple copies of a pdf so I set off to write a program that can watch a folder using filesystemwatcher. From the events that this generates I created a class and instantiated an object that will hold information like full path and last write time. I want to be able to...
1
1251
by: Karthik1979 | last post by:
I have a custom class inherited from List<T> collection. Along with the base class functionality, I have included my additional properties. When serializing, only the base class items are serialized not my additional properties. I have designed a business object collection like this and I have to pass it across the service layer. But in another end I’m getting partial data not all my information is getting de-serialized. Here is a sample...
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10276
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.