W3C home > Mailing lists > Public > www-validator@w3.org > August 2010

Re: Validator fails on PHP instructions inside attribute values

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Mon, 2 Aug 2010 13:55:24 +0200
To: Philip Taylor (Webmaster, Ret'd) <P.Taylor@Rhul.Ac.Uk>
Cc: Dag-Erling Smørgrav <des@des.no>, Richard Ishida <ishida@w3.org>, 'David Dorward' <david@dorward.me.uk>, www-validator@w3.org
Message-ID: <20100802135524183438.c593b4f9@xn--mlform-iua.no>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:18 UTC