c# - "Data at the Root Level is invalid" with LoadXml -
i have code snippet :
xmldocument doc = new xmldocument(); try { doc.loadxml(xmlpath); } catch (exception ex) { string exmessage = ex.message; }
the xml looks this
<?xml version="1.0" encoding="utf-8"?> <mimetypes> <mimetype> <extension>.3dm</extension> <value>x-world/x-3dmf</value> </mimetype> </mimetypes>
its producing error:
data @ root level invalid. line 1, position 1.
any idea what's wrong?
use doc.load(xmlpath). loadxml loading xml string.
Comments
Post a Comment