Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Default html doctype(How to change the html doctype for php files, which is by default html5?)
Default html doctype [message #695188] Mon, 11 July 2011 08:37 Go to next message
Michele Locati is currently offline Michele LocatiFriend
Messages: 5
Registered: July 2011
Location: Como, Italy
Junior Member
I've just update to Eclipse Indigo with PDT 3.0.0.v20110516.

My php files contains some html and Eclipse reports errors for many of them since they use pre-html5 elements (eg the "cellspacing" attribute of "table").
Since my projects are still targeted to html4, is there a way to specify the doctype for these php files?

Thank you
Michele
Re: Default html doctype [message #695525 is a reply to message #695188] Mon, 11 July 2011 23:09 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Unorthodox method:

1. Select html file in PHP Explorer.(if there is no html file, create new one)
2. Right-click > Properties > Web Content Settings.
3. Choose preferred doctype in Document type list.
4. Click OK and exit eclipse.
5. Open {your_workspace}/{your_project}/.settings/org.eclipse.wst.html.core.prefs with text editor.
6. Replace
document-type/{your_file_name}=...
by
document-type/<project>=...
(do not modify "<project>")
7. Start eclipse.

Orthodox method:

<skip since I don't recommend>
Re: Default html doctype [message #695612 is a reply to message #695525] Tue, 12 July 2011 06:47 Go to previous messageGo to next message
Michele Locati is currently offline Michele LocatiFriend
Messages: 5
Registered: July 2011
Location: Como, Italy
Junior Member
Thanks Toshihiro! It worked!
Initially I thought it didn't, since my php files were still reporting html5 validation errors even after a "Refresh" (F5).
But I forced a full rebuild of the project by doing this unorthodox method:
1. I opened one of the php files
2. Select all->Cut (so the file has been emptied)
3. Saved the file
4. Pasted in in its previous content
5. Saved it
Eclipse started a rebuild progess and all the validation errors disappeared, in all the php files.

Thanks a lot!

[Updated on: Tue, 12 July 2011 06:47]

Report message to a moderator

Re: Default html doctype [message #695630 is a reply to message #695612] Tue, 12 July 2011 07:53 Go to previous message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Ah, you're able to validate manually by
Right-click on project or folder or file > Validate
Razz
Previous Topic:eclipse project sharing
Next Topic:Eclipse for PHP Developers is not avilable for download
Goto Forum:
  


Current Time: Thu Apr 25 11:33:20 GMT 2024

Powered by FUDForum. Page generated in 0.24605 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top