PC Review


Reply
Thread Tools Rate Thread

Deserializing XML into an object

 
 
=?Utf-8?B?Tmljaw==?=
Guest
Posts: n/a
 
      5th May 2005
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
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      5th May 2005
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Tmljaw==?=
Guest
Posts: n/a
 
      5th May 2005
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
>
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      5th May 2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serializing / Deserializing XML using System.Xml.Serialization VRSki@newsgroup.nospam Microsoft C# .NET 6 10th Dec 2008 06:11 PM
Deserializing memory stream into XML instead of structure RobinS Microsoft C# .NET 8 24th Feb 2008 09:16 PM
Deserializing whitespace into custom C# string class from XML Al Microsoft Dot NET Framework 0 14th Feb 2008 10:52 PM
Deserializing an XML (soap) file on a pocket pc into a hashtable Carsten Microsoft Dot NET Compact Framework 0 1st May 2006 03:52 PM
System.Xml.Serialization - deserializing xml to types created in dynamic assembly rein.petersen@gmail.com Microsoft Dot NET Framework 0 8th Nov 2005 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:13 PM.