Serialize XML to different object

23 views Asked by At

I have two types of file XML that share some common information but also have some specialization:

<Source Alias="Hrc">
   <Variable HandleType="Ext.Poll">
      <Id>ConfiguredTime</Id>
      <Type>Double</Type>
      <SamplingDimension>15</SamplingDimension>
      <MappedData>Main.Section.Child.BaseBoardLoader[1].IS.Reports.Absolute.ConfiguredTime</MappedData>
   </Variable>
</Source>






<Source Alias="Wrt">
   <Variable>
      <Id>Identification.ProductInstanceUri</Id>
      <Type>String</Type>
      <MappedData EfficientAccess="true">
         <RtdbItem>
            <TableName>IDENTIFICATION</TableName>
            <DataName>ProductInstanceU</DataName>
            <Record>0</Record>
         </RtdbItem>        
      </MappedData>
   </Variable>
</Source>

In this example Source and Variable are the same, while MappedVariable can be string or object type. How can I structure classes for automatic serialize XML?

I've create classes with Paste XML as Classes function of VisualStudio. But don't help me.

0

There are 0 answers