Re: Validator fails on PHP instructions inside attribute values

Philip Taylor (Webmaster, Ret'd), Wed, 21 Jul 2010 12:07:06 +0100:
> Dag-Erling Smørgrav wrote:
> 
>> Regardless of DTD, you can't have unescaped angle brackets inside
>> attribute values;
> 
> That fact I had overlooked.

You can have unescaped angle brackets inside attribute values inside 
SGML - at least according to the HTML4 validator. HTML5 also allows it 
- at least according to Validator.nu. XHTML, including XHTMl5, does not 
allow it. So "pre-validating" as HTML4 or HTML5, instead of as XHTML, 
could be a solution.

>> nor can you write a DTD that makes<?php ...?>
>> something else than a PI or allows its use in places where a PI is not
>> permitted.
> 
> And that I did not know.  Thank you for the clarification.

Again, in SGML, PIs seem permitted inside attributes.

> Philip Taylor (Webmaster, Ret'd), Mon, 19 Jul 2010 16:29:00 +0100:
>> Richard Ishida wrote:
>> 
>>> Perhaps, what I really want then, is a checkbox on the validator 
>> page that says "Remove PHP code before validating", which does just 
>> that, and avoids treating php code as processing instructions.
>> 
>> And then someone else will ask for an option
>> "Remove ASP.NET code before validating", and so on.
>> 
>> To be honest, Richard, you seem to be asking for something that
>> it is not a a validator's responsibility to offer.

PHP selected its syntax _because_ it is HTML4/SGML compatible. ASP.net 
chose another syntax. It is the ASP.NET designers choice to not use PIs.
-- 
leif halvard silli

Received on Monday, 2 August 2010 11:55:58 UTC