I have to read an XML file, but it has ':' in the first node.I am getting this error when I am trying to load the file using XDocument or XElement or xmldocument.I do not know how to resolve this issue.
string _filePath= @"C:\testfile.xml";
XDocument xDoc = XDocument.Load(_filePath);
"The ':' character, hexadecimal value 0x3A, cannot be included in a name. Line 1, position 6".
My XML document:
<?xml:stylesheet type="text/xsl" href="\\10.189.41.02\g$\XMLTest-Viewer.xsl"?>
<TestXml>
//More data here
</TestXml>
If I remove the colon manually I can load the file successfully, is there a way to load the file with the ':' and without changing the XML file?