Bug 415098 - Valid xhtml attributes are not validated in php files
Summary: Valid xhtml attributes are not validated in php files
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 14:28 EDT by Laurent Lyaudet CLA
Modified: 2020-05-14 11:17 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Lyaudet CLA 2013-08-14 14:28:35 EDT
100153
Comment 1 Laurent Lyaudet CLA 2013-08-14 14:39:37 EDT
Hi,

I pressed enter before I finished the description and there is no edit button next to it.

Some attributes of the html tag are not validated (a warning is given when building the project).

Steps to reproduce :
- create a file with following content (named test.php for example):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
</html>

- Ctrl+B
It may somehow be linked to bug 105053.

I don't know for sure if its a PDT issue or a Webtools issue.
Should it be PDT that recognizes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
and asks for xhtml validation to webtools instead of html validation ?

Best regards,
   Laurent Lyaudet
Comment 2 Laurent Lyaudet CLA 2013-08-14 14:41:49 EDT
I forgot to precise that in my example, xmlns and xml:lang attributes are not validated.
Comment 3 Nick Sandonato CLA 2013-08-14 16:03:24 EDT
Hi Laurent,

What version of WTP are you using? If you go to About Eclipse > Installation Details > Features, look for 'Eclipse Web Developer Tools' as the Feature Name. The version should be next to it.

Using Kepler, I have been unable to reproduce the validation problem. Additionally, I actually see the xmlns and xml:lang attributes proposed in content assist. If you remove those attributes in the source and invoke content assist, do you see them in the proposal list?
Comment 4 Laurent Lyaudet CLA 2013-08-16 03:36:15 EDT
Hi Nick,

Sorry for the trouble. Web Tools wasn't installed!
So it means that PDT offers support of html and javascript but probably not xhtml. 
Does it mean that the support of same languages has been developped twice in Eclipse or that part of web tools is integrated in PDT ? Please mail me if the answer to the links between PDT and WTP doesn't fit in this bug.

I noted that, with content assist, version attribute is proposed with PDT alone but not with webtools. Looking at the DTDs for xhtml and html4.01, there shouldn't be a version attribute there.
If the html support of PDT is completely independant from web tools I'll report a bug for that at PDT.

Best regards,
   Laurent
Comment 5 Nick Sandonato CLA 2013-08-16 11:28:27 EDT
(In reply to comment #4)
> Hi Nick,
> 
> Sorry for the trouble. Web Tools wasn't installed!
> So it means that PDT offers support of html and javascript but probably not
> xhtml. 
> Does it mean that the support of same languages has been developped twice in
> Eclipse or that part of web tools is integrated in PDT ? Please mail me if
> the answer to the links between PDT and WTP doesn't fit in this bug.
> 
> I noted that, with content assist, version attribute is proposed with PDT
> alone but not with webtools. Looking at the DTDs for xhtml and html4.01,
> there shouldn't be a version attribute there.
> If the html support of PDT is completely independant from web tools I'll
> report a bug for that at PDT.
> 
> Best regards,
>    Laurent

Hi Laurent,

I tried installing the PDT updatesite onto a Classic Eclipse. The HTML support in PDT is not independent, since the org.eclipse.wst.html plug-ins are installed. The difference that I think may be impacting you with XHTML is that the updatesite does not install org.eclipse.wst.standard.schemas. So I think your problem can be resolved if you install WTP along with PDT.

I'll pass this over to the PDT team, in case they want to consider adding org.eclipse.wst.standard.schemas to the list of plug-ins that they include.
Comment 6 Laurent Lyaudet CLA 2013-08-18 05:42:28 EDT
Hi Nick,

Thanks for your answer.
That's exactly what I did before last comment. I installed WTP along with PDT and it worked fine. 

> The HTML support in PDT is not independent, since the org.eclipse.wst.html
> plug-ins are installed. The difference that I think may be impacting you with
> XHTML is that the updatesite does not install org.eclipse.wst.standard.schemas.
Does it mean that without org.eclipse.wst.standard.schemas eclipse falls back on html support for the xhtml file ? In that case the small bug of "version" attribute proposed in content assist for <html> tag is a bug in org.eclipse.wst.html?

Best regards,
   Laurent
Comment 7 Nick Sandonato CLA 2013-08-29 16:24:07 EDT
(In reply to comment #6)
> Hi Nick,
> 
> Thanks for your answer.
> That's exactly what I did before last comment. I installed WTP along with
> PDT and it worked fine. 
> 
> > The HTML support in PDT is not independent, since the org.eclipse.wst.html
> > plug-ins are installed. The difference that I think may be impacting you with
> > XHTML is that the updatesite does not install org.eclipse.wst.standard.schemas.
> Does it mean that without org.eclipse.wst.standard.schemas eclipse falls
> back on html support for the xhtml file ? In that case the small bug of
> "version" attribute proposed in content assist for <html> tag is a bug in
> org.eclipse.wst.html?
> 
> Best regards,
>    Laurent

Hi Laurent,

Sorry for the late reply. I don't think it's a bug since it's falling back on a known content model where 'version' is valid, though deprecated.
Comment 8 Laurent Lyaudet CLA 2013-09-17 11:19:48 EDT
Hi Nick,

Thanks for the reply. I checked that indeed "version" attribute appears in the loose dtd but not in the strict dtd for HTML4.

I haven't found a way to specify a default dtd for html editor.
Which leads me to the following question:
If including nested html with include mechanism of php, how can you validate the nested html according to the DTD of the including webpage?
With Ajax you can't even statically analyse the inclusion tree to allow only what is accepted by the parent DTD.

Let me know if there exists a way to specify a default DTD for Editor/Validator with WTP. Otherwise, I'll open a feature request for this point (I haven't found any existing for this particular feature).

Best regards,
   Laurent Lyaudet
Comment 9 Dawid Pakula CLA 2015-06-09 08:20:22 EDT
Fixed indirectly via bug 468837.

PDT since 3.5 require WTP Web feature, so also schemas plugin.
Comment 10 Sylvia Tancheva CLA 2015-06-18 04:29:52 EDT
Closing