मैं नीचे की तरह एक XML फ़ाइल है:अपवाद: XPath अभिव्यक्ति अप्रत्याशित प्रकार के लिए मूल्यांकन System.Xml.Linq.XAttribute
<Employees>
<Employee Id="ABC001">
<Name>Prasad 1</Name>
<Mobile>9986730630</Mobile>
<Address Type="Perminant">
<City>City1</City>
<Country>India</Country>
</Address>
<Address Type="Temporary">
<City>City2</City>
<Country>India</Country>
</Address>
</Employee>
अब मैं सब पता प्रकार के मिल चाहते हैं।
मैंने XPath का उपयोग करके नीचे की तरह कोशिश की और मुझे अपवाद मिल रहा है।
var xPathString = @"//Employee/Address/@Type";
doc.XPathSelectElements(xPathString); // doc is XDocument.Load("xml file Path")
अपवाद: XPath अभिव्यक्ति अप्रत्याशित प्रकार System.Xml.Linq.XAttribute करने का मूल्यांकन किया।
क्या मेरे XPath के साथ कोई समस्या है?