Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys! I have to ask you help for XML serialization.

I have to deserialize this XML document (a piece of electronic invoice):

XML
<ElectronicInvoice>
  <Header>
    <Transmission>
      <Id>
        <IdCountry>IT</IdCountry>
        <VatNumber>12345689</VatNumber>
      </Id>
      <Code>123456</Code>
      <TransmissionFormat>ABC</TransmissionFormat>
      <Contacts>
        <Phone>05512345</Phone>
        <Email>foo@mail.com</Email>
      </Contacts>
    </Transmission>
  </Header>
</ElectronicInvoice>


I try to deserialize with XMLSerializer, so each class in ElectronicInvoice has to implement IXMLSerializer interface.
How can I implement the ReadXML() method?

Sorry for my english. Thank you in advance.
Posted

1 solution

Here, on CP site, you'll find several articles about serialization and deserialization of XML. Please, use SearchBox[^] on the right-top corner of this site, for example: A Complete Sample of Custom Class Collection Serialization and Deserialization[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900