XmlDocument.Load Vs XmlDocument.LoadXml

前端 未结 5 1520
面向向阳花
面向向阳花 2021-01-07 18:41

I just came across with a problem using XmlDocument.LoadXml.

The application was crashing, giving the following error:

\"Data at

5条回答
  •  醉话见心
    2021-01-07 19:26

    The application was crashing with the following error: "Data at the root level is invalid. Line 1, position 1" I suspect you xml data does not have a root level: for example:

    
      dataata
    
    
      dataataa
    
    

    you need have at least one root level on top of the bottom levels. for example:

    
      
        dataata
      
      
        dataataa
      
    
    

    so please put one mother on the top of your level, make it grand grand mother of all children

提交回复
热议问题