Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » unnecessary <li> closing tag required(HTML validator is too strict for list item tag)
unnecessary <li> closing tag required [message #781113] Fri, 20 January 2012 10:18 Go to next message
Julien Robinson is currently offline Julien Robinson
Messages: 3
Registered: January 2012
Junior Member
Hi all,
I've looked through the web and these forums but not found anything about this particular (minor) issue.

I have a project with PHP and HTML. Whenever I use an HTML list with <li> items, I get warnings "invalid location of tag (li)". These appear to be provoked by the missing closing tag </li>. However, closing tags are not mandatory for <li> per the HTML 4 spec.

Question 1: how can I tell the validator about <li> and other tags that don't need to be closed ?

Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http:/ /www.w3.org/TR/html4/strict.dtd"><!-- remove the space in the link! -->
<html>
<head><title>blabla</title></head>
<body>
<ul>
<li>foo
<li>bar
</ul>
</body>
</html>

some (indirect) documentation about closing tags here: http:/ /stackoverflow.com/questions/3008593 (remove the space in the link)
(great read, BTW)


I'd better say, because otherwise I might get this answer: I do not think it's a good idea to disable warnings, such as "invalid location of tag" (I know how to do that), or to introduce exceptions for the specific files (I also know how to do that). Warnings may be useful in another context, one never knows.

Another remark: I've tried it with and without the first line "<!DOCTYPE...", the results are the same.

Yet another remark: what's strange is that if I add </li> and save, the warnings disappear; then I remove the </li>, the warnings still don't come back!! But if afterwards I rebuild the project... the warnings are back!

Question 2: could it be a matter of refreshing the project properties, or removing an XML validator that perhaps is taking precedence?

Oh, and of course, my working versions:
Version: Helios Release
Build id: 20100617-1415

with plug-in "SVN team provider" added.

Thanks for any tips!
JR

PS : spaces in links because I don't have the rights to post links
Re: unnecessary <li> closing tag required [message #782369 is a reply to message #781113] Mon, 23 January 2012 11:01 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick Sandonato
Messages: 126
Registered: July 2009
Senior Member
Hi Julien,

You may want to try and newer build of WTP. This was fixed in Helios SR1 [1]. Upgrading to Indigo will also contain this fix.

[1] https://bugs.eclipse.org/308412

- Nick

[Updated on: Mon, 23 January 2012 11:06]

Report message to a moderator

Re: unnecessary <li> closing tag required [message #782705 is a reply to message #782369] Tue, 24 January 2012 04:13 Go to previous message
Julien Robinson is currently offline Julien Robinson
Messages: 3
Registered: January 2012
Junior Member

Quote:
You may want to try and newer build of WTP. This was fixed in Helios SR1 [1]. Upgrading to Indigo will also contain this fix.


Thanks a lot, I hadn't found that bug and patch (sometimes, GINYF! Smile ).

I used Helios (and not any other distribution) because I'm working with PHP (I try to stick to packaged distributions to avoid losing time with consistency of plug-ins).

A newbie question: what's Helios SR1?
I thought I had the latest version...
Previous Topic:getAppletContext() In Eclipse IDE?
Next Topic:How to create schema to wsdl
Goto Forum:
  


Current Time: Tue Jul 29 18:56:43 EDT 2014

Powered by FUDForum. Page generated in 0.04362 seconds