Deserializing XML into an object

G

Guest

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
 
C

Cor Ligthert

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
 
G

Guest

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?
 
C

Cor Ligthert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top