In below Xml, I tried to delete the xmlns attribute but, its unable to populate under, xmlNode.Attributes still appear under OuterXml and final XmlDocument.
...
<z:Datac knid="2" xmlns="http://services/api/"></z:Datac>
...
<z:Datac knid="3" xmlns="http://services/api/"></z:Datac>
....
<z:Datac knid="5" xmlns="http://services/api/"></z:Datac>
....
How to remove xmlns attribute for each z:Datac element?
foreach (var item in nodes)
{
var xmlnsAttribute = (item.Attributes has "xmlns" attribute)
if (xmlnsAttribute != null)
{
Remove xmlNode... //not able to reach here as not able to find xmlns.
}
}
I don't have xml.linq