I was writing a xml data reader in Java using JDK’s inbuilt XML processing libraries (JAXP) when I persistently hit across this annoying exception with error message: A pseudo attribute name is expected.我写的XML数据读者在Java中使用JDK的内置的XML处理图书馆( jaxp ) ,当我坚持打击跨越这恼人的例外与错误讯息:一个伪属性名称是可预见的。 The error is displayed on the first line itself.错误是显示在第一线本身。

Google search wasn’t of much help. Google搜索没有多大帮助。 I tried few suggestions, which were not of any use.我尝试的几点建议,不被任何使用。 Then I noticed the obvious.然后我注意到显而易见的。

My xml instruction was:我的XML的指示是:
< ?xml version="1.0" > < ? XML版本= “ 1.0 ” >

It was a typo.这是一个错字。 It should have been:它应该已经:
< ?xml version="1.0" ?> < ? XML版本= “ 1.0 ” ? >

Obviously the xml instruction was illegal.很明显, XML的指令是非法的。 However the error message was cryptic and gave no hint to the actual cause of the problem.不过,错误讯息是隐形了,没有暗示的实际问题的原因。