Hi, I am having an xml file. I want to change the attribute name of one node.
in this i want to change the pub-id-type into book-id-type. i tried with following code. but i always got null error. what is the problem in that.
doc.XPathSelectElement("//book-meta/book-id").Attribute("pub-id-type").Remove();
doc.XPathSelectElement("//book-meta/book-id").SetAttributeValue("book-id-type", "doi");
Thanks in advance.

Midhun TpRank #388 · 6.5K reputationPosted Apr 7, 2017, 2:04 AM EDT
Karthi KeyanRank #1,926 · 762 reputationPosted Apr 7, 2017, 2:27 AM EDT