0

I am working on deserializing XML file where a same class has different namespaces. I am getting error while The specified type was not recognized. Here is a snippet from the XML I am trying to parse

<BookingHistory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="dbpnr" xsi:type="ns3:SegmentHistory" Segment="ID13" eventDate="2014-04-03" eventTime="05:29:00" actionType="Change"/>
<BookingHistory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="dbpnr" xsi:type="ns3:SsrHistory" eventDate="2014-04-03" eventTime="14:06:00" actionType="Add">
<BookingHistory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="dbpnr" xsi:type="ns3:RemarkHistory" eventDate="2014-04-03" eventTime="15:02:00" actionType="Add">

Here is the sample XML

https://drive.google.com/file/d/1RDOAGa2TECSIauSHkdYTuSNuTWx5GVb8/view

Any suggestions would be highly appreciated.

Anil C
  • 1,045
  • 3
  • 16
  • 38
  • Can you share a full [mcve] that includes a well-formed XML document we can test? The `xsi:type` attribute is used to specify polymorphic subtype when deserializing a polymorphic type hierarchy, see e.g. [Deserialize XML with multiple types](https://stackoverflow.com/a/50535903/3744182) or [xsi:type attribute messing up C# XML deserialization](https://stackoverflow.com/a/36365689/3744182). We need to see the full XML to suggest how to deal with this properly. – dbc May 10 '22 at 14:39
  • Link for XML file has been added to the Question @dbc – Anil C May 12 '22 at 10:50

0 Answers0