This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
For XHTML 1.0 (but not for HTML 4.01): We get the warning: "character "<" is the first character of a delimiter but occurred as data" and the error: "StartTag: invalid element name" for the following: ......... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>TEST</title> <script type="text/javascript"> function test(){ for (i=0; i < length; i++){ } } </script> </head><body></body> </html> ......... However, with "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>" the code is passed. Regards, Rolf Walter
I don't see a bug here; XHTML gets validated by XML rules which are stricter/different than SGML rules which are used for HTML.
(In reply to comment #1) > I don't see a bug here; XHTML gets validated by XML rules which are > stricter/different than SGML rules which are used for HTML. Pasting the lines between the "........" into http://validator.w3.org/#validate_by_input yields the error mentioned. The error points to code within the script tag, which is, in this case, corect JS. Besides, normally, the validator does not react on erroneous JS code within a script tag. /Rolf
Sure it does, as it should. That's not a bug in the validator, that's an issue in the document which the validator correctly flags, and it even says in the explanation below the error message: | You tried to include the "<" character in your page: | you should escape it as "<" Even if your JS is "correct", it is incorrectly embedded in the XHTML doc. More info: http://www.w3.org/TR/xhtml1/#h-4.8 http://www.w3.org/TR/xhtml1/#C_4
(In reply to comment #3) Thanks a lot, I didn't realize this.