Re: PHP code only allowed in XHTML 5?

Leif Halvard Silli writes:

> Suppose one wants to validate a page that embeds PHP, but that one
> wants  to do so /prior/ to the execution of the PHP script:
>
>        <?php Print "Hello, World!"; ?>

How can that be a meaningful thing to do?  What if the PHP script emits
something which causes an error, such as misnested tags?  The
conformance checker would be giving the author the impression that the
page is conforming, yet what gets sent to the browser clearly isn't.

And why should PHP have this ability and not other programming or
templating languages, such as those which use <% ... %> or [% ... %]?

If this is deemed a useful feature there's nothing stopping a
conformance checker developer providing an option for 'strip PHP tags',
which could be implemented as a pre-processing step to passing the
remaining content to an HTML 5 parser.  Or indeed for any other template
syntax, regardless of whether it resembles SGML processing instructions.
But doing so doesn't require the language itself to be warped to allow
this.

Smylers

Received on Wednesday, 22 July 2009 05:00:37 UTC