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

Popular posts from this blog

python - TypeError: start must be a integer -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

html - href attribute breaking an element -