Help!. Conversion of XML to data objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Q2Fpcm4=?=

    Help!. Conversion of XML to data objects

    I have some XML data which I wish to relate to existing classes, but data
    does not map exactly so serialsation will not work, the other consideration
    is that some of the XML data will need transposing during the convertion. My
    considerations are to either use :-
    1.) XSLT initially carry out the converstion so converting some of the data
    ( space and comma seperated pairs into alist of points) and the go to the
    required data objects,
    or
    2.) using XLINQ in someway to convert from the XML file to the objects.
    Does anybody have any advice on the better of the methods, or any
    alterantives.
    The other consideration is that the XML will be very large with a mixture of
    differing objects (the objects are already pre known).

    Thanks in advance.
  • Joe Fawcett

    #2
    Re: Help!. Conversion of XML to data objects



    "Cairn" <Cairn@discussi ons.microsoft.c omwrote in message
    news:E6D01C0A-1965-4A29-ACB3-E08A1EFECC15@mi crosoft.com...
    I have some XML data which I wish to relate to existing classes, but data
    does not map exactly so serialsation will not work, the other
    consideration
    is that some of the XML data will need transposing during the convertion.
    My
    considerations are to either use :-
    1.) XSLT initially carry out the converstion so converting some of the
    data
    ( space and comma seperated pairs into alist of points) and the go to the
    required data objects,
    or
    2.) using XLINQ in someway to convert from the XML file to the objects.
    Does anybody have any advice on the better of the methods, or any
    alterantives.
    The other consideration is that the XML will be very large with a mixture
    of
    differing objects (the objects are already pre known).
    >
    Thanks in advance.
    You can still use XML serialisation, you just need to implement the
    IXmlSerializabl e interface and write your own ReadXml method.
    See
    http://msdn.microsoft.com/en-us/libr...ializable.aspx.

    --

    Joe Fawcett (MVP - XML)


    Comment

    • =?Utf-8?B?Q2Fpcm4=?=

      #3
      Re: Help!. Conversion of XML to data objects

      Thanks for that, but a number of the existing classes are from the framework,
      and I do not want to go through all the code (1000000+) and start renaming
      all the classes so that I can add the Ixmlserializabl e interface to all of
      them.


      "Joe Fawcett" wrote:
      >
      >
      "Cairn" <Cairn@discussi ons.microsoft.c omwrote in message
      news:E6D01C0A-1965-4A29-ACB3-E08A1EFECC15@mi crosoft.com...
      I have some XML data which I wish to relate to existing classes, but data
      does not map exactly so serialsation will not work, the other
      consideration
      is that some of the XML data will need transposing during the convertion.
      My
      considerations are to either use :-
      1.) XSLT initially carry out the converstion so converting some of the
      data
      ( space and comma seperated pairs into alist of points) and the go to the
      required data objects,
      or
      2.) using XLINQ in someway to convert from the XML file to the objects.
      Does anybody have any advice on the better of the methods, or any
      alterantives.
      The other consideration is that the XML will be very large with a mixture
      of
      differing objects (the objects are already pre known).

      Thanks in advance.
      You can still use XML serialisation, you just need to implement the
      IXmlSerializabl e interface and write your own ReadXml method.
      See
      http://msdn.microsoft.com/en-us/libr...ializable.aspx.
      >
      --
      >
      Joe Fawcett (MVP - XML)

      >

      Comment

      • Joris van Lier

        #4
        Re: Help!. Conversion of XML to data objects

        "Cairn" <Cairn@discussi ons.microsoft.c omwrote in message
        news:BBACAB1D-0E2F-42B3-A9AE-145CC380581C@mi crosoft.com...
        Thanks for that, but a number of the existing classes are from the
        framework,
        and I do not want to go through all the code (1000000+) and start renaming
        all the classes so that I can add the Ixmlserializabl e interface to all of
        them.
        >

        You can use the ISerializationS urrogate interface to delegate the
        serialization to another class,
        see my post titled "Mapping between schemata while serializing" in this
        newsgroup.

        How to serialize an object which is not marked as 'Serializable' using a
        surrogate.


        Joris

        Comment

        Working...