xml文件不能被正确解析/The processing instruction target matching "[xX][mM][lL]" is not allowed.

The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception:org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

这个异常解释为:xml文件不能被解析,一般出现这样的问题在于xml格式上,并且问题多出现在xml文件的头部。我就是出现了这个问题。昨天还可以正常运行的,今天来了就运行不了了,很奇怪,查看了下错误信息,找到了原因。这是因为我的xml文件头部有两行空行,第三行才开始写

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
的。

总结:<?xml version="1.0" encoding="UTF-8"?>前面不要有任何其他字符,如空格、回车、换行这些否则就会出现上面的异常。

org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed(转)的更多相关文章

  1. web.xml文件报错:The processing instruction target matching "[xX][mM][lL]" is not allowed.

    昨晚把我的项目上传到了gitlab,然后今天在公司从gitlab下载下来, 发现web.xml报错.

  2. 关于解决 The processing instruction target matching "[xX][mM][lL]" is not allowed

    在处理和保存XML文件时,出现The processing instruction target matching "[xX][mM][lL]" is not allowed 错误 ...

  3. (转)ERROR : The processing instruction target matching "[xX][mM][lL]" is not allowed.

    现象:ERROR   : The processing instruction target matching "[xX][mM][lL]" is not allowed. 异常解 ...

  4. Android报错:The processing instruction target matching "[xX][mM][lL]" is not allowed.

    报错!!! The processing instruction target matching "[xX][mM][lL]" is not allowed. Attention! ...

  5. The processing instruction target matching ''[xX][mM][lL]" is not allowed

    报错的来源是: <?xml version="1.0" encoding="UTF8"?> 解决方案::,一般是WSDL的头文件的格式出了问题,比如 ...

  6. 出现 The processing instruction target matching "[xX][mM][lL]" is not allowed错误

    错误原因与解决办法: 这个错误的原因是因为xml的开始有多余的空格造成的,只要把多余的空格删除就没有问题了. xml开始部分写注释也会出现此问题. 本文出自:艺意

  7. The processing instruction target matching &quot;[xX][mM][lL]&quot; is not allowed.

    现象: ERROR   : The processing instruction target matching "[xX][mM][lL]" is not allowed.  异 ...

  8. dom4j解析xml报错:Nested exception: org.xml.sax.SAXParseException: White space is required between the processing instruction target and data.

    采用dom4j方式解析string类型的xml xml:        String string="<?xmlversion=\"1.0\" encoding=\ ...

  9. IDEA运行TestNG报错rg.testng.TestNGException: org.xml.sax.SAXParseException;

    从eclipse复制的依赖注解,一运行测试脚本发现报错如下: "F:\Program Files\Java\jdk1.7.0_17\bin\java" -ea -Didea.lau ...

随机推荐

  1. 当面试官问我ArrayList和LinkedList哪个更占空间时,我这么答让他眼前一亮

    前言 今天介绍一下Java的两个集合类,ArrayList和LinkedList,这两个集合的知识点几乎可以说面试必问的. 对于这两个集合类,相信大家都不陌生,ArrayList可以说是日常开发中用的 ...

  2. __getattribute__和item系列

    # class Foo: # def __init__(self,x): # self.x=x # # def __getattr__(self, item): # print('执行的是我') # ...

  3. Vue组件注册

    全局注册方法 Vue.component('my-component-name', { // ... 选项 ... }) Vue.component('component-a', { /* ... * ...

  4. java数组与数组异常

    一 数组的定义 1.第一种定义方法: 格式: 数据类型[] 数组名=new 数据类型[数组长度] 2.第二种定义方法: 格式: 类型[] 数组名 = new 类型[]{元素,元素,.....} 3.第 ...

  5. Revit二次开发——非模态窗口的事件处理

    一.起因    自己在写revit二开时,有一个Winform窗体按钮点击事件需要 触发调用事务进行处理,结果出现“异常“Starting a transaction from an external ...

  6. Golang gRPC学习(03): grpc官方示例程序route_guide简析

    代码主要来源于grpc的官方examples代码: route_guide https://github.com/grpc/grpc-go/tree/master/examples/route_gui ...

  7. Fiddler+模拟器+APP抓包HTTPS 为什么有时候抓不到?

    抓包的原理是什么? 代理 客户端请求 -> 经过代理 -> 到达服务端 服务端返回 -> 经过代理 -> 到达客户端 任何Https的App都能抓到包么? Android7.0 ...

  8. UML活动图(二)

    转载于https://www.cnblogs.com/xiaolongbao-lzh/p/4591953.html 活动图概述 •活动图和交互图是UML中对系统动态方面建模的两种主要形式 •交互图强调 ...

  9. 阿里云鼠标垫,云中谁寄锦书来,阿里云定制GIT指令集鼠标垫

    活动地址 云中谁寄锦书来 活动时间 2020.8.19-8.28 奖品 必得,每日200份,共2000份 参考答案 tips:单选选择以上都是,多选就是全选 云效DevOps包含哪些产品- ABCDE ...

  10. centos yum 安装golang

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum install golan ...