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

Re: Validator fails on PHP instructions inside attribute values

From: Philip Taylor (Webmaster, Ret'd) <P.Taylor@Rhul.Ac.Uk>
Date: Tue, 20 Jul 2010 17:47:49 +0100
Message-ID: <4C45D335.3020409@Rhul.Ac.Uk>
To: Dag-Erling Smørgrav <des@des.no>
CC: Richard Ishida <ishida@w3.org>, 'David Dorward' <david@dorward.me.uk>, www-validator@w3.org


Dag-Erling Smørgrav wrote:

 > Feel free to write one (it should only take a few lines of Perl) and run
 > it on your code before submitting it to the validator, but it's not
 > really a good idea, because the code you validate will not be the same
 > as what the user's browser sees.

I think there is a better solution : write a custom DTD that
extends the DOCTYPE against which you are trying to validate
by making all well-formed constructs of the form

	<?php echo $clang;?>

legal within attribute values and anywhere else that you
wish to use them but which do not satisfy the formal
requirements for a Processing Instruction (PI), then
validate against that DTD.

Philip Taylor
Received on Tuesday, 20 July 2010 16:48:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:43 GMT