Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Re: XML tags are just a cheap rip-off of PHP tags

From: Kelly Miller <lightsolphoenix@gmail.com>
Date: Fri, 24 Jun 2005 00:35:54 -0400
Message-ID: <42BB8DAA.3010503@gmail.com>
To: David Woolley <david@djwhome.demon.co.uk>
CC: www-html@w3.org

If you're not really familiar with how SGML processing instructions 
work, it's very easy to make XHTML containing PHP invalid. One common 
PHP structure is this:

<img src="<?php echo $image_fdr + "/image.jpg"; ?>" alt="<?php echo 
"This is a test image."; ?>" />

But that is invalid XML, because XML doesn't allow < and > to appear in 
attributes. Techinically, the proper way of doing it would be to make 
the whole tag echoed, but I believe there is a rule that disallows < and 
 > in processing instructions too, isn't there?

Then again, PHP processing instructions don't follow the same structure 
as XML or SGML processing instructions, either.

David Woolley wrote:

>>I donā??t think it is as much a matter of stealing as that they just had 
>>to pick a delimiter character - had they used e.g. % instead of ?, the 
>>ASP and JSP folks would perhaps not have liked that.
>>    
>>
>
>I don't know the early history of PHP, but I strongly suspect that they
>use ? for the same reason that XML uses it, namely it is the proper
>way of forming an SGML processing instruction.  The name after
>the ? tells you what processor is supposed to handle that instruction,
>so there is no conflict between XML and PHP if you use properly
>formed processing instructions.
>
>For some reason, PHP also chose to allow an abbreviated form, that
>doesn't indicate the processor, so will cause conflicts, but that
>was just a convenience for pure HTML use.  It makes the resulting
>input document invalid, whereas the full form is valid SGML.
>  
>

-- 
http://www.mozilla.org/products/firefox/  - Get Firefox!
http://www.mozilla.org/products/thunderbird/  - Reclaim Your Inbox!
Received on Friday, 24 June 2005 04:35:46 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.