The processing instruction target matching "[xX][mM][lL]" is not allowed
2009-10-22 10:53
441 查看
读取xml文件时出现如下错误,原来在xml文件的每一行开头都有空字符串,才导致这个错误。
**Parsing Fatal Error**
Line: 1 URI: file:/C:/xampp/htdocs/mytest/resources/xml/afsin.xml
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Error in parsing: Fatal Error encountered
在vi中如何去除空字符串呢?
按下面这个方法即可
from http://blog.chinaunix.net/u2/63696/showart_506107.html
删除多余的空格
行末:$
行首:^
空格:/s
行末空格:/s/+$
行首空格:^/+/s
有些人认为行末的空格是无用,浪费而难看的。要删除这些每行后面多余的空格,可以
执行如下命令:
命令前面指明范围是 "%",所以这会作用于整个文件。"substitute" 命令的匹配模式是
"/s/+$"。这表示行末($)前的一个或者多个(/+)空格(/s)。后面我们会介绍怎样
写这样的模式。|usr_27.txt|。
替换命令的 "to" 部分是空的:"//"。这样就会删除那些匹配的空白字符。
另一种没有用的空格是 Tab 前面的字符。通常这可以删除而不影响格式。但并不是总这
样!所以,你最好手工删除它。执行如下命令:
你什么都看不见,其实这是一个空格加一个 TAB 键。相当于 "/
你可以用 "x" 删除多余的空格,并保证格式没有改变。接着你可以用 "n" 找到下一个
位置并重复这个操作。
--------------------------------------------------------------------------------------------------
既然我的空字符串在行首,相应的命令为:
:%s/^/+/s//
如果是删除行首一个空字符则是:
:%s/^/s//
**Parsing Fatal Error**
Line: 1 URI: file:/C:/xampp/htdocs/mytest/resources/xml/afsin.xml
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Error in parsing: Fatal Error encountered
在vi中如何去除空字符串呢?
按下面这个方法即可
from http://blog.chinaunix.net/u2/63696/showart_506107.html
删除多余的空格
行末:$
行首:^
空格:/s
行末空格:/s/+$
行首空格:^/+/s
有些人认为行末的空格是无用,浪费而难看的。要删除这些每行后面多余的空格,可以
执行如下命令:
:%s//s/+$//
命令前面指明范围是 "%",所以这会作用于整个文件。"substitute" 命令的匹配模式是
"/s/+$"。这表示行末($)前的一个或者多个(/+)空格(/s)。后面我们会介绍怎样
写这样的模式。|usr_27.txt|。
替换命令的 "to" 部分是空的:"//"。这样就会删除那些匹配的空白字符。
另一种没有用的空格是 Tab 前面的字符。通常这可以删除而不影响格式。但并不是总这
样!所以,你最好手工删除它。执行如下命令:
/
你什么都看不见,其实这是一个空格加一个 TAB 键。相当于 "/
<Space>
<Tab>"。现在,
你可以用 "x" 删除多余的空格,并保证格式没有改变。接着你可以用 "n" 找到下一个
位置并重复这个操作。
--------------------------------------------------------------------------------------------------
既然我的空字符串在行首,相应的命令为:
:%s/^/+/s//
如果是删除行首一个空字符则是:
:%s/^/s//
相关文章推荐
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- XML解析异常之 The processing instruction target matching "[xX][mM][lL]" is not allowed.
- XML问题: The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- 成功解决问题[Fatal Error] test.xml:1:7: The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- 由于空格引起的xml错误之The processing instruction target matching "[xX][mM][lL]" is not allowed以及the markup in the document prec
- xml The processing instruction target matching "[xX][mM][lL]" is not allowed
- 关于XML文件的异常:The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- Parse Fatal Error at line 1 column 7: The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL] "is not allowed错误解决办法总结
- ofbiz fop 报错 The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
- The processing instruction target matching "[xX][mM][lL]" is not allowed
- The processing instruction target matching "[xX][mM][lL]" is not allowed.