Parsing xml string to an xml document fails if the string begins with <?xml… ?> section

前端 未结 5 952
闹比i
闹比i 2021-01-01 11:41

I have an XML file begining like this:




        
5条回答
  •  醉话见心
    2021-01-01 11:51

    Do you have a byte-order-mark (BOM) at the beginning of your XML, and does it match your encoding ? If you chop out your header, you'll also chop out the BOM and if that is incorrect, then subsequent parsing may work.

    You may need to inspect your document at the byte level to see the BOM.

提交回复
热议问题