0

以下のコードで州名に基づいて州コードを取得しようとしています:

        XPathDocument document = new XPathDocument("D:/Sample.xml");
        XPathNavigator navigator = document.CreateNavigator();
        XPathNavigator node =  navigator.SelectSingleNode("//WorldCountry/Country/states/states[@name='Maharastra']");
        string statescode=node.Attributes.GetNamedItem("code").Value

But I am getting error in list line saying that "**XPathNavigator** does not contain a defination of **Attributes**"
4

1 に答える 1