473,498 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deserializing XML into an object

Hi,

I'm facing a problem when I have to deserialize an XML into an object. The
typical scenario is as follows:
The XML that I have to deserialize has multiple elements of the same type
(lets say multiple occurences of <abc />) with different inner texts.
Now if I use the already available deserialize method of the XMLSerialize
object, then it returns me only the first element's inner text if I try to
extract in a variable of type string. However, I would like all the element
values to come in as an arraylist (preferably). When I tried deserializing
into a variable of type arraylist, it did not give me anything.
Is there any way to achieve this?

I also tried implementing the IXMLSerializable interface, but am apparently
stuck.
Please help me out!

Nick
Jul 21 '05 #1
3 1359
Nick,

Always the same question on this, why not a dataset which has (is build for)
in my opinion all elements you ask for.

Cor
Jul 21 '05 #2
But then, won't using a dataset make the application unnecessarily heavy? In
my case, performance is of utmost importance.
Keeping in view, the XML I'm dealing with is very elementary, having
children only of the root node, and no attributes at all whatsoever.
Something of the sort:
<abc>
<xyz>xyz</xyz>
<pqr>pqr</pqr>....
(probably about 30-40 elements like this... with some repetition of the
same element)
</abc>
Was earlier using the DOM, but that was about 2-3x slower than this
XMLSerialize object approach.
Could you by any chance quantify the time / speed if I use a dataset?

"Cor Ligthert" wrote:
Nick,

Always the same question on this, why not a dataset which has (is build for)
in my opinion all elements you ask for.

Cor

Jul 21 '05 #3
Nick,

How many times in a day is your user doing this operation and how much time
daily is affected with that?

I have never noticed the time of the reading of this kind of dataset from
disk.

How many rows are you thinking about a Million?

Cor
Jul 21 '05 #4

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

Similar topics

1
2029
by: Justin Armstrong | last post by:
I'm having difficulties deserializing some objects. Consider the following example of what I'm trying to do: ---------------------------------------------------------- class Person { string...
0
2202
by: Kenneth Baltrinic | last post by:
I am getting the following error when deserializing an object that has a couple of dozen dependant objects in its object graph. Anyone who can suggest where I might begin to look to resolve problem...
1
1832
by: Thomas | last post by:
Hi, I implemented a composite pattern which should be serializable to xml. After spending some time in the newsgroups, i finally managed serializing, even with utf-8 instead of utf-16, which...
3
5548
by: Mark McConnell | last post by:
Regarding deserializing XML into a custom object... I've been able to deserialize an XML doc into my custom object and everything works great. The problem I am encountering is when one of the...
4
7497
by: Wayne Wengert | last post by:
Using VB.NET I want to read in an XML file that has an array of objects and then step through the resulting array in code. I build a class to define the structure and I am running code to read in...
5
5001
by: Lucas | last post by:
Well, here's the situation.. It's pretty simple; just that I can't get it to work. I have 2 Executables.. The first one is called CSharp.exe which is a simple WinForm App. I have a single...
0
1943
by: Casey | last post by:
So I'm using XmlSerializer to serialize out a wrapper object that contains an arbitrary number of other objects. The class definitions listed below are made to be very generic. Some of the...
2
3739
by: Phillip Galey | last post by:
I have an object called Place which contains only string properties and has the <Serializable()> flag before the class name declaration. I also have a collection object called Places, which is...
4
1061
by: Andrew E Chapman | last post by:
What happens to an object which is not nothing has another object deserialized into it? I assume that the data in it is completely destroyed by the new object. I am interested because I have...
1
11752
by: =?Utf-8?B?SmVyZW15X0I=?= | last post by:
I am working on an order entry program and have a question related to deserializing nodes with nested elements. The purchase order contains multiple line items which I select using an...
0
7167
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
7208
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...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
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...
0
5464
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,...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
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 ...
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.