Re: Buxa Coding Guidelines
| From: | brian | Date: | Sun, 09 Sep 2007 18:11:59 +0000 |
| Subject: | Re: Buxa Coding Guidelines | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261877@lists.php.net to get a copy of this message | ||
Per Jessen wrote:
brian wrote:SemanticsPer Jessen wrote:I'm not parsing it, apache does that.magoo wrote:If you're parsing XHTML that is choking on any instances of "<%" then you've got a problem with your script.In their oppinion stuff like the short PHP init "<?" or inline echo "<?= $var ?>" is forbidden. Do you people code that strict?Yep. If you're using XHTML you have no other option.
An XHTML document will start with: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head>Uh-huh ... but then that's not a PHP script, is it? To be more specific, something on the server that is meant to parse XHTML should not be encountering PHP syntax. If it does, then it is either wrongly attempting to parse a PHP script instead of XHTML, or your PHP script has syntax errors. IOW, if you've got some PHP scripts that *output* XHTML, PHP shouldn't be leaving behind its own opening and closing tags. If it is (as i said earlier) you've got a problem with your script. Or, perhaps what you mean is that the <?xml tag might be interpreted by PHP (as opposed to an XHTML parser misinterpreting PHP tags)? If that's the case, simply don't leave it bare in the script. Have PHP print it. brian