I think those exceptions would be acceptable for now. I like the concept of an XML document that contains PHP code. Just like you have XML documents that contain Javascript code. I think they should be parsable. Since PHP was made for the web, I think we should try to obey the rules of the web as much as possible.

But that's just me. :) I understand it will be tough to banish short tags all together since so much code depends on it. Losing the ASP style tags is a step in the right direction at least.

... And now I'm gonna drink too much beer! Wishing everyone a great weekend!

-Bart



Rasmus Lerdorf wrote:
Bart de Boer wrote:
I feel I can't disagree with my hero. :) But is that really so?

The XML spec says:

PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'

Doesn't Char* mean any char?

All the parsers seem to accept '>' inside PI's without problems too.

If you pick your standards carefully, sure.  ;)

I chose the PHP syntax before there was an XML spec.  Back in the dark
ages where HTML was defined as an SGML DTD.  In SGML-speak <? is a
general delimiter called PIO, < is STAGO and > is PIC.  In those early
HTML DTD's you couldn't have a PIO element that contained STAGO or PIC.
ISO-8879 has all the uglyness in it if you want to dig a bit, but even
with that it doesn't really tell the whole story of the conditions at
the time.

The point being that it was a conscious decision to not try to strictly
comply with the specification at the time or to write a PHP DTD, but
instead to focus on convenience first and the spec second.  You still
have plenty of things you can do today that doesn't match modern XML
specs.  For example:

  <?php echo '?>'; ?>

Or anything with ctrl chars in it.  You can put a literal 0x07 char in a
quoted string, for example, and PHP will happily pass that through, but
that is also not allowed in the spec.

-Rasmus

Reply via email to