When occasionally using XML, and being confronted to this error, I once lost too much time on this. Even if one goes through an XML tutorial, remembering the XML declaration requirements/restrictions is not something garanteed to last in the long term memory.
In this situation (when the XML decalration does not start at first char), personnally, I have learned to interpret the Xerces error message, but I can undersand the frustration of users that are not as familiar with XML. Defining appropriate error messages is an art. While the current error message is absolutly true, a hint on the possible cause of this error may save some research time for some users. Claude Montpetit ----- Original Message ----- From: Joseph Kesselman To: [EMAIL PROTECTED] Sent: Monday, November 11, 2002 8:45 AM Subject: Re: BUG14378 . Error parsing XML document with a leading white space character. There's not a lot of discussion needed here. The XML Declaration MUST be the first thing in the file if present, with the sole exception of the byte order mark. This comes right out of the grammar. (See productions 1, 22, 23 in the XML 1.0 Recommendation, available at http://www.w3.org/TR/.) Processing instructions, which share the <??> syntax with the XML Declaration, MUST NOT use the target name "XML" in any mixture of upper and lower case. (See production 17.) That's reserved for use by the W3C, and so far they have (correctly, in my opinion) not chosen to use it. Hence there's no question of "a misplaced declaration" -- if it isn't in the right place, it isn't a declaration and with that name it can't be anything else. All the examples in Jan's note are quite clearly ill-formed. (A good XML tutorial should have covered this point.) ______________________________________ Joe Kesselman / IBM Research --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
