[PATCH] ext. dom php_dom.c
| From: | John Huntjens | Date: | Fri, 11 Jul 2003 11:20:14 +0000 |
| Subject: | [PATCH] ext. dom php_dom.c | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-3361@lists.php.net to get a copy of this message | ||
Hello list,
Version 5.0.0b1
Extension dom
File: php_dom.c
Test script:
$dom = new domDocument();
$dom->load('test.xml');
print $dom->savexml();
test.xml:
<?xml version="1.0"?>
<!DOCTYPE app [
<!ENTITY sysmenu SYSTEM "test2.xml"> ]>
<app>&sysmenu;</app>
test2.xml:
<?xml version="1.0"?>
<menu>test</menu>
When running the test script, in the entitys get not expanded.
But the standard
http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-D
OMConfiguration
says about this:
"entities"
true [required]
Keep EntityReference and Entity nodes in the document.
Issue normalizationFeature-9:
How does that interact with expand-entity-references? ALH suggests
consolidating the two to a single feature called "entity-references" that is
used both for load and save.
Resolution: Consolidate both features into a single feature called
'entities'. (Telcon 27 Jan 2002).
false [required] (default)
Remove all EntityReference and Entity nodes from the document, putting the
entity expansions directly in their place. Text nodes are into "normal"
form. Only EntityReference nodes to non-defined entities are kept in the
document.
Proposal:
change line 542 of php_dom.c
from:
xmlInitParser();
into:
xmlInitParser();
/*
http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-D
OMConfiguration
section entitys:
"entities"
false [required] (default)
Remove all EntityReference and Entity nodes from the document, putting the
entity expansions
directly in their place. Text nodes are into "normal" form. Only
EntityReference nodes to non-defined
entities are kept in the document.
*/
xmlSubstituteEntitiesDefault(1);