Re: Validator fails on PHP instructions inside attribute values

"Richard Ishida" <ishida@w3.org> writes:
> I'm beginning to understand that the processing instruction thing is
> clouding the issue, since php code is not inside processing
> instructions.  

Not entirely correct.  PHP uses the <? ... ?> syntax to hide from XML
validators so you can run your templates through, say, xmllint without
having to run the application.  Of course, it only works in simple
cases.

> So I suppose that what I really want is a pre-processor that goes
> through my code and removes everything between <?php ... ?> (taking
> care obviously to avoid literal strings containing such delimiters),
> before the validation starts.  

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.

DES
-- 
Dag-Erling Smørgrav - des@des.no

Received on Tuesday, 20 July 2010 09:49:43 UTC