XML deserialization from string

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

    XML deserialization from string

    Hi,

    I have an XSD and created a VB.NET class file from it. When I have an
    XML file (conforming to the schema), it is straight forward to
    deserialize using the class file.

    I am looking for ways to deserialize when I have the XML as a string
    and not in a file. Writing the string to a file and deserializing from
    the file might have an adverse effect on the performance.

    Anyone know of a good method to do this?

    Any help will be appreciated.
    Thanks,
    Sampath.
  • Dare Obasanjo [MSFT]

    #2
    Re: XML deserialization from string

    Use a StringReader to read the file and wrap that in an XmlTextReader.

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

    "Sampath" <tsampath@gmail .com> wrote in message
    news:ec666781.0 406011357.37649 ceb@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > I have an XSD and created a VB.NET class file from it. When I have an
    > XML file (conforming to the schema), it is straight forward to
    > deserialize using the class file.
    >
    > I am looking for ways to deserialize when I have the XML as a string
    > and not in a file. Writing the string to a file and deserializing from
    > the file might have an adverse effect on the performance.
    >
    > Anyone know of a good method to do this?
    >
    > Any help will be appreciated.
    > Thanks,
    > Sampath.[/color]


    Comment

    • Dare Obasanjo [MSFT]

      #3
      Re: XML deserialization from string

      Use a StringReader to read the file and wrap that in an XmlTextReader.

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

      "Sampath" <tsampath@gmail .com> wrote in message
      news:ec666781.0 406011357.37649 ceb@posting.goo gle.com...[color=blue]
      > Hi,
      >
      > I have an XSD and created a VB.NET class file from it. When I have an
      > XML file (conforming to the schema), it is straight forward to
      > deserialize using the class file.
      >
      > I am looking for ways to deserialize when I have the XML as a string
      > and not in a file. Writing the string to a file and deserializing from
      > the file might have an adverse effect on the performance.
      >
      > Anyone know of a good method to do this?
      >
      > Any help will be appreciated.
      > Thanks,
      > Sampath.[/color]


      Comment

      Working...