#28207 [NEW]: Different output in PHP 5 with stream-oriented XML parsing.
| From: | bart at mediawave dot nl | Date: | Wed, 28 Apr 2004 15:18:14 +0000 |
| Subject: | #28207 [NEW]: Different output in PHP 5 with stream-oriented XML parsing. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-58954@lists.php.net to get a copy of this message | ||
From: bart at mediawave dot nl
Operating system: Windows 2000
PHP version: 5.0.0RC2
PHP Bug Type: XML related
Bug description: Different output in PHP 5 with stream-oriented XML parsing.
Description:
------------
The stream-oriented XML parser (formerly Expat) produces different output
in PHP 5 than it did in PHP 4. I'm unable to read the
<?xml version='1.0'?>
<!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [
<!ENTITY plainEntity "FOO entity">
<!ENTITY systemEntity SYSTEM "xmltest2.xml">
]>
section of the XML document with PHP 5.
Reproduce code:
---------------
The code under "Example 3. External Entity Example" at
http://www.php.net/manual/en/ref.xml.php
Expected result:
----------------
<?xml version='1.0'?>
<!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [
<!ENTITY plainEntity "FOO entity">
<!ENTITY systemEntity SYSTEM "xmltest2.xml">
]>
<CHAPTER>
<TITLE>Title &plainEntity;</TITLE>
<PARA>
<INFORMALTABLE>
<TGROUP COLS="3">
<TBODY>
<ROW><ENTRY>a1</ENTRY><ENTRY
MOREROWS="1">b1</ENTRY><ENTRY>c1</ENTRY></ROW>
<ROW><ENTRY>a2</ENTRY><ENTRY>c2</ENTRY></ROW>
<ROW><ENTRY>a3</ENTRY><ENTRY>b3</ENTRY><ENTRY>c3</ENTRY></ROW>
</TBODY>
</TGROUP>
</INFORMALTABLE>
</PARA>
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY testEnt "test entity">
]>
<FOO>
<ELEMENT ATTRIB="value"></ELEMENT>
&testEnt;
This is some more PHP code being executed.
</FOO>
<SECTION ID="about">
<TITLE>About this Document</TITLE>
<PARA>
<!-- this is a comment -->
Hi! This is PHP version 4.3.6
</PARA>
</SECTION>
</CHAPTER>
parse complete
Actual result:
--------------
&plainEntity;<CHAPTER>
<TITLE>Title &plainEntity;</TITLE>
<PARA>
<INFORMALTABLE>
<TGROUP COLS="3">
<TBODY>
<ROW><ENTRY>a1</ENTRY><ENTRY
MOREROWS="1">b1</ENTRY><ENTRY>c1</ENTRY></ROW>
<ROW><ENTRY>a2</ENTRY><ENTRY>c2</ENTRY></ROW>
<ROW><ENTRY>a3</ENTRY><ENTRY>b3</ENTRY><ENTRY>c3</ENTRY></ROW>
</TBODY>
</TGROUP>
</INFORMALTABLE>
</PARA>
&systemEntity;
<SECTION ID="about">
<TITLE>About this Document</TITLE>
<PARA>
<-- this is a comment -->
Hi! This is PHP version 5.0.0RC2
</PARA>
</SECTION>
</CHAPTER>XML error: Undeclared entity warning at line 27
--
Edit bug report at http://bugs.php.net/?id=28207&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28207&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28207&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28207&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28207&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28207&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28207&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28207&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28207&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28207&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28207&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28207&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28207&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28207&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28207&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28207&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28207&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28207&r=float