|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-29 05:42 UTC] sniper@php.net
[2003-09-29 15:37 UTC] bart at mediawave dot nl
[2003-09-29 21:13 UTC] sniper@php.net
[2003-09-30 01:42 UTC] bart at mediawave dot nl
[2003-10-02 17:17 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 00:00:01 2025 UTC |
Description: ------------ With the XML parser module PHP currently handles processing instruction code per tag. For example: <?php echo 'Hello World' ?> is seen as an isolated chunk of code. This doesn't work: <XMLTAG> <?php for ($i = 0; $i < 4; $i++): ?> <XMLTAG2> <?php echo $i ?> </XMLTAG2> <?php endfor; ?> </XMLTAG> PHP handles the PHP code per <? somecode ?> tag. While in this example the code actually spans through 5 tags. But PHP doesn't recognize it this way. Also. For my application it would be desirable if the PHP XML parser would not return the php code. The evaluation of the PHP code in the XML should be hanled by the parser. It should then only return the resulting (evaluated) XML as if it was normal XML. Reproduce code: --------------- <?xml version="1.0" encoding="iso-8859-1"?> <XMLTAG> <?php for ($i = 0; $i < 4; $i++): ?> <XMLTAG2> <?php echo $i ?> </XMLTAG2> <?php endfor; ?> </XMLTAG> Expected result: ---------------- <XMLTAG> <XMLTAG2> 0 </XMLTAG2> <XMLTAG2> 1 </XMLTAG2> <XMLTAG2> 2 </XMLTAG2> <XMLTAG2> 3 </XMLTAG2> </XMLTAG> Actual result: -------------- Parse error: parse error, unexpected $end in D:\php-4.3.2\PEAR\wrap_v4\dam.php(544) : eval()'d code on line 1 Parse error: parse error, unexpected T_ENDFOR in D:\php-4.3.2\PEAR\wrap_v4\dam.php(544) : eval()'d code on line 1