Re: PHP code only allowed in XHTML 5?

Thomas Broyer On 09-07-22 12.03:

> On Wed, Jul 22, 2009 at 11:30 AM, Leif Halvard Silli wrote:
>> Do we want the anomaly that <?php ... ?> is valid XHTML 5, but invalid HTML
>> 5?
> 
> Yes, just like:
>  - <feed xmlns="http://www.w3.org/2005/Atom">
>  - xmlns:foo="http://example.net"
>  - <foo:bar />
>  - <p />


I thought HTML 5 was about "HTML, in his own right" ... Those are 
all specific XHTML syntax examples (although many of us want 
xmlns="" to be valid in HTML 5 as well).

What a strange message to send to PHP users, that they should use 
XHTML5. ;-)

 
>> What about the UA support, should it be ignored?
> 
> Which UA support?


See below.

> In text/html, <?php is parsed as a comment


According to Live DOM viewer, only Opera and IE render it as a 
comment in the DOM. (See my first message.) And this UA behavior 
doesn't seem to documented in the HTML 5 draft - despite its said 
parsing focus ...

> (and ends at the first ">"


Already noted in my first message - the SGML/HTML PI syntax starts 
with "<?" and ends with the first occurrence of ">".

> on at least Firefox and Opera: try it with <?php echo "hello
> <b>world</b>!"; ?>)


So it ends with the ">" in "<b>". Where is the news? UAs support 
the SGML/HTML PI syntax - that is why it works like this - and it 
is also in accordance with how the W3 validator sees it.

>> What about current
>> validators - Validator.w3.org and HTML Tidy? And so on. Should we pretend
>> that support for <? > doesn't exist?
> 
> In "HTML as she is spoke"? yes.

I disagree that we should pretend.
-- 
leif halvard silli

Received on Wednesday, 22 July 2009 10:42:42 UTC