If you have an XElement obj how do you get the tag name of the xelement object?
doc.Descendants("name").Where(x => (string) x == cit.name).FirstOrDefault().Parent
i would like to get the tagname of this xelement object.
Once you have the right XElement
, you can use Name
property like so:
<someNamespace:someElement attr="blah"/>
string name = element.Name.LocalName;
//will get "someElement"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With