W3C home > Mailing lists > Public > www-validator@w3.org > May 2008

Re: [VE][xmlwf]Couldn't find end of Start Tag img seems to be caused by a long URL as the img src?

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 25 May 2008 23:29:26 +0300
Message-ID: <021001c8bea6$09835670$0500000a@DOCENDO>
To: "Jade" <jade@edufone.com>, <www-validator@w3.org>

Jade wrote:

> Validating http://www.best-learn-spanish.com/s/indexTemplate.php
[...]
> 1. Error <http://validator.w3.org/images/info_icons/error.png> Line
> 244, Column > 80: XML Parsing Error: attributes construct error.
> However, the same data but with a relative vs. an absolute URL
> validates in this document:
> http://www.best-learn-spanish.com/s/index.html

The problem has nothing to do with relative vs. absolute URLs or with 
URL length (as you suspect in the Subject line). Interesting guesses, 
but wrong.

The problem is caused by lack of whitespace between attribute 
specifications. You have this tag:

<img 
src="http://www.best-learn-spanish.com/s/gifs/bttn_member_utility.gif"width="157"height="30" 
alt="become a member" border="0"/>

Note the lack of space before and after the attribute specification
width="157"

If you divide the long line to shorter lines, the validator will 
indicate the specific location of the problem. This is one reason who 
long HTML source lines are problematic. Of course, adding linebreaks or 
other whitespace may change the meaning, but it is always safe to insert 
a line break between attribute specifications.

The validator apparently has a problem with lines longer than 80 
characters in some situations. I'm not sure whether this is would be 
worth fixing; it depends on the ease of fixing, which in turn depends on 
the internal structures and logic.

Also note that compatibility recommendations (such the infamous Appendix 
C) say that you should use a space before the /> construct that 
terminates a "self-closing" tag. It is however not a syntax error to 
omit the space.

I also noted that the validator no more issues a warning about undefined 
character references like &#149; (the http://www.htmlhelp.com/validator/ 
still reports them). In any case, you should fix them; use &bull; or 
&#8226; or switch to an encoding, such as windows-1252 or utf-8, that 
lets you enter the bullet characters as such.

(Technically, &#149; is not an error, but its meaning is undefined.)

Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/ 
Received on Sunday, 25 May 2008 20:29:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:29 GMT