I have an XML file which i want to alter but for some reason it wont let me alter specific elements. Im calling the file like this:
XDocument doc = XDocument.Load(@"C:\t.xml");
but when i try to use LINQ or any other form it returns null. I checked and the document has schema tags and namespaces:
<Document xmlns="urn:test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
once theses are removed i can alter the elements but when they are in, i cant. What is the work around for this?
Code Sample Update
XElement schema = doc.Element("Document");
if (schema.Attribute("xlmns") != null && schema.Attribute("xlmns:xs") != null)
{
schema.Attribute("xlmns").Remove();
}