Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #25686 : XML processing instruction handling feature request
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 11th December 08:48
php-bugs
External User
 
Posts: 1
Default #25686 : XML processing instruction handling feature request



From: bart at mediawave dot nl
Operating system: All
PHP version: Irrelevant
PHP Bug Type: Feature/Change Request
Bug description: XML processing instruction handling feature request

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


--
Edit bug report at http://bugs.php.net/?id=25686&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25686&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25686&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25686&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25686&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25686&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25686&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25686&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25686&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25686&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25686&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25686&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25686&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25686&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25686&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25686&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25686&r=float
  Reply With Quote


  sponsored links


2 11th December 08:49
External User
 
Posts: 1
Default #25686 : XML processing instruction handling feature request



ID: 25686
Updated by: sniper@php.net
Reported By: bart at mediawave dot nl
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: All
PHP Version: Irrelevant
New Comment:

With PHP 4.3.3 I get the correct output.
Disable short-tags maybe?

Previous Comments:
------------------------------------------------------------------------

[2003-09-29 04:38:50] bart at mediawave dot nl

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

------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=25686&edit=1
  Reply With Quote
3 11th December 20:42
php-bugs
External User
 
Posts: 1
Default #25686 : XML processing instruction handling feature request


ID: 25686
User updated by: bart at mediawave dot nl
Reported By: bart at mediawave dot nl
-Status: Bogus
+Status: Open
Bug Type: Feature/Change Request
Operating System: All
PHP Version: Irrelevant
New Comment:

Excuse me if I was not clear enough. This "problem" occurs when parsing
the specified XML file with the Expat XML functions. I get this problem
with PHP 4.3.2, PHP 4.3.3 and PHP 5.0.0 beta.

You can reproduce the problem with the code on
http://www.php.net/manual/en/ref.xml.php under "Example 3. External
Entity Example" and using the following XML for xmltest.xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<XMLTAG>
<?php for ($i = 0; $i < 4; $i++) { ?>
<XMLTAG2>
<? echo $i ?>
</XMLTAG2>
<?php } ?>
</XMLTAG>


Previous Comments:
------------------------------------------------------------------------

[2003-09-29 05:42:00] sniper@php.net

With PHP 4.3.3 I get the correct output.
Disable short-tags maybe?


------------------------------------------------------------------------

[2003-09-29 04:38:50] bart at mediawave dot nl

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

------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=25686&edit=1
  Reply With Quote
4 11th December 20:43
External User
 
Posts: 1
Default #25686 : XML processing instruction handling feature request


ID: 25686
Updated by: sniper@php.net
Reported By: bart at mediawave dot nl
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: All
PHP Version: Irrelevant
New Comment:

You don't need to use XML functions for this,
just include() the file..

Previous Comments:
------------------------------------------------------------------------

[2003-09-29 15:37:46] bart at mediawave dot nl

Excuse me if I was not clear enough. This "problem" occurs when parsing
the specified XML file with the Expat XML functions. I get this problem
with PHP 4.3.2, PHP 4.3.3 and PHP 5.0.0 beta.

You can reproduce the problem with the code on
http://www.php.net/manual/en/ref.xml.php under "Example 3. External
Entity Example" and using the following XML for xmltest.xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<XMLTAG>
<?php for ($i = 0; $i < 4; $i++) { ?>
<XMLTAG2>
<? echo $i ?>
</XMLTAG2>
<?php } ?>
</XMLTAG>

------------------------------------------------------------------------

[2003-09-29 05:42:00] sniper@php.net

With PHP 4.3.3 I get the correct output.
Disable short-tags maybe?


------------------------------------------------------------------------

[2003-09-29 04:38:50] bart at mediawave dot nl

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

------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=25686&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666