SQL保存XML报错 “XML 分析: 行 1,字符 47,非法的 xml 字符”

例如:

 1 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 2 <eventsRequest>
 3   <eventHeader>
 4   <sender>AAA</sender>
 5   <receiver>BBB</receiver>
 6   <sendDate>2017-11-16 13:30:06</sendDate>
 7   <messageType>responseServices</messageType>
 8   <messageId>50743097-32cb-4409-ab59-bd8169d67967</messageId>
 9 </eventHeader>
10   <eventBody>
11     <response>
12     <command>Response</command>
13     <oriMessageType>inOrderReceiveServices</oriMessageType>
14     <responseType>2</responseType>
15     <oriMessageId>50743097-32cb-4409-ab59-bd8169d67967</oriMessageId>
16     <custNo>中国</custNo>
17     <orderNo>AAAAAAA</orderNo>
18     <orderDate>2017-11-16 13:30:06</orderDate>
19     <status>True</status>
20     </response>
21   </eventBody>
22 </eventsRequest>

 

解决方案一:去掉

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

 

解决方案二:修改

<?xml version="1.0" encoding="utf-8" standalone="yes"?>  中的编码格式改成:“GB2312”

问题原因:因为XML文档中包含中文,所以不能使用  "utf-8"  格式的编码,只能使用    “GB2312”

相关文章:

  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案