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. The error is displayed on the first line itself.

Google search wasn’t of much help. I tried few suggestions, which were not of any use. Then I noticed the obvious.

My xml instruction was:
< ?xml version="1.0" >

It was a typo. It should have been:
< ?xml version="1.0" ?>

Obviously the xml instruction was illegal. However the error message was cryptic and gave no hint to the actual cause of the problem.