I have the follwoing XML
<?xml version="1.0" ?>
<SERVICES.OUTPUTResponse>
<Results>
<Result>
<Dataset name="OutputData">
<Row>
<country>USA</country>
<pubyear>9986</pubyear>
<numart>123</numart>
<numcites>456</numcites>
</Row>
<Row>
<country>USA</country>
<pubyear>97</pubyear>
<numart>895</numart>
<numcites>231</numcites>
</Row>
</Dataset>
<Dataset name="Result 2">
<Row>
<Result_2>
true
</Result_2>
</Row>
</Dataset>
</Result>
</Results>
<_Probe></_Probe>
</SERVICES.OUTPUTResponse>
and i tried to deserialize by using XmlSerializer but it returns null.
The Property class which i used is
public class XMLDetails
{public string country { get; set; } public string pubyear { get; set; } public string numart { get; set; } public string numcites { get; set; } }
Deserialize code is
XmlRootAttribute xRoot = new XmlRootAttribute();
xRoot.ElementName = "SERVICES.OUTPUTResponse";
xRoot.IsNullable = true;
var serializer = new XmlSerializer(typeof(XMLDetails), xRoot);
var reader = new StringReader(remoteXml);
var objpublication = (XMLDetails)(serializer.Deserialize(reader));
Please help me to reslove it
If you want to use Linq To Xml
PS: required namespaces
System.Xml.LinqandSystem.Xml.XPath