Skip to main content



      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 04:37 Go to next message
Eclipse UserFriend
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 19:09 Go to previous messageGo to next message
Eclipse UserFriend
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 02:47 Go to previous messageGo to next message
Eclipse UserFriend
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 02:47] by Moderator

Re: Default html doctype [message #695630 is a reply to message #695612] Tue, 12 July 2011 03:53 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 18:04:02 EDT 2025

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

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

Back to the top