xml文件下载报This XML file does not appear to have any style information associated with it. The document

xml文件下载报This XML file does not appear to have any style information associated with it. The document

可能是原文件缺失了文件声明
正常的xml文件



 

有问题就像这样


 

没有



2020-05-29补充

有时候通过接口下载XML文件,即使文件中加了还是报这样的错,这时候可以在response设置Header

JAVA版

response.setHeader("Content-Disposition", "attachment; filename=" + name + ".bpmn20.xml");
response.setContentType("application/octet-stream");

go语言版

//设置Content-Type
w.Header().Add("Content-Type", "application/octet-stream")
w.Header().Add("Content-Disposition", "attachment; filename=\""+name+"\".bpmn20.xml")

你可能感兴趣的:(JAVA知识,xml)