Re: Need help with cryptic validator error message

Michele Cleary wrote:

> http://lyle.smu.edu/~mcleary/a4/getUserTable2.php
[...]
>         Line 3, Column 5:
>         XML Parsing Error:  XML declaration allowed only at the start
> of the document.

The error message is relatively to clear to me, even though the rule it 
refers to might be counter-intuitive. The XML declaration, i.e. <?xml etc. 
must (if present) be the very first thing in the document. Not even an empty 
line, a comment, or even an innocent space is allowed before it; this is 
formally expressed in the production rule at
http://www.w3.org/TR/REC-xml/#sec-prolog-dtd
Note the absence of anything before "XMLDecl" in the production for 
"prolog". Otherwise the productions contain "S?" where whitespace (such as 
empty lines) are allowed.

> ***This is my getUserTable2.php:

That's external to validation. Validation only deals with the document that 
your server sends in respose to a request.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Sunday, 8 March 2009 19:50:08 UTC