Since the general consensus by the developers is not to remove the short_tags 
or even disable them. Perhaps we should consider alternate solutions to this 
problem. Given the buzzword popularity of XML and its slowly growing 
popularity among website designers (XHTML) this issue is likely to come up in 
the future yet again.
The solution I would like to offer, is a patch that adds special handling for 
<?xml. Thus preventing the language parser from attempting to parse data 
inside <?xml as PHP source.

Ilia
Index: zend_language_scanner.l
===================================================================
RCS file: /repository/Zend/zend_language_scanner.l,v
retrieving revision 1.49
diff -u -3 -p -r1.49 zend_language_scanner.l
--- zend_language_scanner.l     15 Aug 2002 00:22:38 -0000      1.49
+++ zend_language_scanner.l     16 Oct 2002 16:07:27 -0000
@@ -1194,6 +1194,14 @@ NEWLINE ("\r"|"\n"|"\r\n")
 }
 
 
+<INITIAL>"<?xml"{WHITESPACE} {
+       zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
+       zendlval->value.str.len = yyleng;
+       zendlval->type = IS_STRING;
+       return T_INLINE_HTML;
+}
+
+
 <INITIAL>"<%="|"<?=" {
        if ((yytext[1]=='%' && CG(asp_tags)) || (yytext[1]=='?' && CG(short_tags))) {
                zendlval->value.str.val = yytext; /* no copying - intentional */

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to