ID: 30219 Updated by: [EMAIL PROTECTED] Reported By: tg_surf at hotmail dot com Status: Feedback Bug Type: XML related Operating System: Windows 2000 PHP Version: 5.0.1 New Comment:
Test your script with PHP 4.3 and if output different add it here with the expected output. The tests I ran with that xml snippet produced same output under 4.3 (using expat) and 5 (using libxml). In both cases the entities were not resolved in element content. Previous Comments: ------------------------------------------------------------------------ [2004-11-19 16:47:16] joern_h at gmx dot net I tested this with a current snapshot (php5-win32-200411190730.zip), entities inside attributes are now reported correctly but entities in element content are silently ignored. Here is an example document that show this behaviour: <!DOCTYPE test [ <!ENTITY uuml "ü"> ]> <test t="ü">ü</test> ------------------------------------------------------------------------ [2004-11-18 21:17:56] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip ------------------------------------------------------------------------ [2004-11-12 13:13:25] michiel at trendserver dot nl Also occurs on PHP 5.02 ------------------------------------------------------------------------ [2004-09-24 13:51:52] tg_surf at hotmail dot com Description: ------------ When trying to parse the following xml file I get an "Undeclared entity error" in PHP5. With PHP4 it works fine. Reproduce code: --------------- The code under "Example 3. External Entity Example" at http://www.php.net/manual/en/ref.xml.php with the following xml file: <?xml version="1.0"?> <!DOCTYPE rdf:RDF [ <!ENTITY test 'http://www.hpl.hp.com/semweb/2003/query_tester#'> <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> ]> <rdf:RDF xmlns:rdf="&rdf;" xmlns="&test;"> <Test rdf:about="test1"> <description>RDFS reasoner: range test, wildcard</description> <tbox>rdfs/tbox1.rdf</tbox> <data>rdfs/data1.rdf</data> <query>rdfs/query-res.nt</query> <result>rdfs/result1.rdf</result> </Test> </rdf:RDF> Expected result: ---------------- <?xml version="1.0"?> <!DOCTYPE rdf:RDF [ <!ENTITY test 'http://www.hpl.hp.com/semweb/2003/query_tester#'> <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> ]> <RDF:RDF XMLNS:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" XMLNS="http://www.hpl.hp.com/semweb/2003/query_tester#"> <TEST RDF:ABOUT="test1"> <DESCRIPTION>RDFS reasoner: range test, wildcard</DESCRIPTION> <TBOX>rdfs/tbox1.rdf</TBOX> <DATA>rdfs/data1.rdf</DATA> <QUERY>rdfs/query-res.nt</QUERY> <RESULT>rdfs/result1.rdf</RESULT> </TEST> </RDF:RDF> parse complete Actual result: -------------- &test;&rdf;&rdf;&test;XML error: Undeclared entity error at line 7 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30219&edit=1