Solving - “A pseudo attribute name is expected” Error in JAXP

By Angsuman Chakraborty, Gaea News Network
Thursday, July 6, 2006

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.

Filed under: How To, Java Software, Tech Note
Discussion
July 7, 2010: 5:07 am

Cool. Thanks.


Sara
July 14, 2009: 1:31 pm

Thanks Alot - realy save me a lot of time to find the cause of this error


Andrea
June 2, 2008: 5:44 am

Same as Mark here… thanks to you, now Google DOES help!

April 4, 2008: 2:45 am

Happy to be of help.


Mark Ghosh
April 2, 2008: 2:31 pm

Thanks for the point Angsuman, exact issue with CF here and it solved the problem.


Ally
October 6, 2006: 8:40 am

Thank you for your post. I got a similar error message from a webservice I was calling. “WebServicesFault … Error in line 1: pseudo attribute name is expected”
xml was my third parameter, but I was calling a TPM web service and couldn’t find server-side trace so I had no indication that it was during xml parsing of my 3rd parameter.
Yours is the only post on the web that was useful. Without it it would’ve taking me a very long time to figure this one out.
Thank you very much.
Ally

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :