Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ Forum ➜ Suggestions ➜ HTML validation

HTML validation

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by David Haley   USA  (3,881 posts)  Bio
Date Thu 28 Sep 2006 05:47 AM (UTC)
Message
Hi Nick; I installed an HTML validator extension for Firefox and it's complaining an awful lot about the forum output. Seems that it's unhappy about <li/> tags; it wants them to be simply <li>. Here are some example warning messages:

line 417 column 6 - Warning: missing <li>

line 417 column 1 - Warning: trimming empty <li>


Basically these happen for every list item on the page.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 28 Sep 2006 07:18 AM (UTC)
Message
I submitted a sample page with such things in it, namely:

http://www.gammon.com.au/forum/?id=6581

to the W3C validator and it passed the validation:

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.gammon.com.au%2Fforum%2F%3Fid%3D6581

It said:

This Page Is Valid HTML 4.01 Transitional!


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 28 Sep 2006 07:35 AM (UTC)
Message
The reason I used <li/> is that, strictly speaking in XML, if there is no closing </li> then the opening <li> should be <li/>.

However I understand HTML is not strict XML.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Thu 28 Sep 2006 08:05 AM (UTC)
Message
Hmm. Looks like something is wrong with the validator plug-in, since indeed, the W3C validator seems happy and they set the standard after all.

About <li/>, though, in XML is that really valid? You're putting content in the <li> element therefore the CDATA has to be between open and close tags. Interestingly, though, if I remember correctly, the validators complain about closing the <li> tag...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #4 on Thu 28 Sep 2006 08:21 AM (UTC)
Message
Well, the validator accepted it, so is that, by definition, valid?

However I take your point. If you see this page:

http://www.w3.org/TR/html401/struct/lists.html

They seem to be suggesting that <li> is correct (without the </li> too). In XML that simply would not be correct.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #5 on Thu 28 Sep 2006 04:55 PM (UTC)
Message
Oh, I think I know what might be going on. My validator is giving warnings, not errors, whereas the W3C validator seems to only care about errors. At least, I can't see to turn on warnings for it. For instance my validator gives other warnings too, e.g. from this submit page:

line 324 column 7 - Warning: entity "&nbsp" doesn't end in ';'

line 121 column 38 - Warning: <textarea> proprietary attribute "wrap"


David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,093 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.