I have XML where I have a namespace _spreadSheetNameSapce. In my code, I have to add a new element with an attribute associated with the space name, and I do it as follows
XElement customHeading = new XElement("Row",
new XAttribute(_spreadSheetNameSapce + "AutoFitHeight", "0"));
It creates correctly XElement, but also inserts an element xmlns=""into the same element. I do not want this element to be created. How can I create XElementwithout an empty namespace or how to delete a namespace after creating an element?
source
share