<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" targetNamespace="http://www.w3schools.com" elementFormDefault="qualified"> <xs:element name="CASES" > <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="CASE"> <xs:complexType> <xs:sequence> <xs:element name="RECEIVED_DATE" type="xs:string" minOccurs="0" /> <xs:element name="DIVISION_CODE" type="xs:string" minOccurs="0" /> <xs:element name="LOCATION_CODE" type="xs:string" minOccurs="0" /> <xs:element name="LOCATION_NAME" type="xs:string" minOccurs="0" /> <xs:element name="LOCATION_ADDRESS1" type="xs:string" minOccurs="0" /> <xs:element name="PARTIES" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="PARTY" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="FIRST_NAME" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="LAST_NAME" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> </xs:sequence> <xs:attribute name="TYPE_DESCRIPTION" type="xs:string" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
StreamReader reader = new StreamReader(_myXmlPath); XmlSerializer serializer = new XmlSerializer(typeof(CASES)); CASES myCases = (CASES)serializer.Deserialize(reader); //error occure
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)