From:             tg_surf at hotmail dot com
Operating system: Windows 2000
PHP version:      5.0.1
PHP Bug Type:     XML related
Bug description:  Undeclared entity error in PHP5

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 bug report at http://bugs.php.net/?id=30219&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30219&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30219&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30219&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30219&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30219&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30219&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30219&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30219&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30219&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30219&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30219&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30219&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30219&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30219&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30219&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30219&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30219&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30219&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30219&r=mysqlcfg

Reply via email to