W3C home > Mailing lists > Public > public-html@w3.org > July 2009

Re: PHP code only allowed in XHTML 5?

From: Nick Fitzsimons <nick@nickfitz.co.uk>
Date: Wed, 22 Jul 2009 17:12:52 +0100
Message-ID: <ad9d9dc0907220912h2550cf98s83c8c844dd54ec42@mail.gmail.com>
To: HTML WG <public-html@w3.org>
2009/7/22 Leif Halvard Silli <lhs@malform.no>:
> If the coding style is to produce valid PIs, then it is a disservice to
> prevent validation.
>

As has already been pointed out, a construct such as

<p class="<?php echo 'foo' ?>"></p>

is perfectly OK as far as PHP is concerned, but is not well-formed
XML (and I believe not well-formed SGML either), as the "<" character
(and therefore a PI) cannot appear at that position [1]. So even if
PIs were added to the spec, PHP developers would still have every
chance of getting validation errors. Thus there seems to be little
point in adding PIs to the spec, as doing so won't even solve the
supposed problem that makes you wish to see them included.

Note that HTML 4.01 did not include PIs as one if the "SGML Constructs
Used in HTML" [2], but relegated them to an appendix as something that
"should not be used" [3]. So it's not as if there's ever been any
reason to expect an HTML validator to handle them even when they are
situated in a valid location within the document.

[1] <http://www.w3.org/TR/2008/REC-xml-20081126/#CleanAttrVals>
[2] <http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2>
[3] <http://www.w3.org/TR/html401/appendix/notes.html#sgmlfeatures>

Regards,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/
Received on Wednesday, 22 July 2009 16:13:34 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:48 UTC