Deserializing XML into an object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick

    #1

    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 IXMLSerializabl e interface, but am apparently
    stuck.
    Please help me out!

    Nick
  • Cor Ligthert

    #2
    Re: Deserializing XML into an object

    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


    Comment

    • Nick

      #3
      Re: Deserializing XML into an object

      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:
      [color=blue]
      > 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
      >
      >
      >[/color]

      Comment

      • Cor Ligthert

        #4
        Re: Deserializing XML into an object

        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


        Comment

        Working...