0

My xml file contains data like

<THE-VALUE><div xmlns="http://www.w3.org/1999/xhtml"> <h1 class="firstHeading" id="firstHeading">Starbucks</h1><img alt="Embedded image" id="_1378207355918" src="_f6e2e77a-904d-4526-a215-660955f56377?accept=none&amp;private"/><p id="_1378207355840"><br/></p> </div></THE-VALUE>

Thus my xml file has a tag that contains xhtml content.

I have no control over this file as I am receiving this file from other sources. Now while deserializing using XmlSerializer, I am facing problem.

I know this query has been posted earlier also. But I couldn't find any satisfactory answer. Can someone suggest any solution? Should I implement IXmlSerializable?

user3282758
  • 1,379
  • 11
  • 29

1 Answers1

0

This may not exactly answer your question, but it will probably get you on the right track. Per your question, this person did use IXmlSerializable in their example and showed how to use it in a case similar to yours. It seems that it would be easily adaptable to your situation:

Deserialize element value as string although it contains mixed content

Community
  • 1
  • 1
Rob W.
  • 270
  • 6
  • 14