# [PHP DOM] Proposal of boolean property DOMDocument::keepCharacterEntities

- Thread: https://externals.io/message/32858
- Original archive: https://news-web.php.net/php.internals/32858
- Started by Freyjkell on 2007-10-18T16:30:46+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #32858 — Freyjkell — 2007-10-18T16:30:46+00:00

URL: https://externals.io/message/32858#32858

(bool) DOMDocument::keepUnknownCharacterEntities = false;

If set to true (before calling DOMDocument::load() or 
DOMDocument::loadXML()), when parser will occur an unknown entity, it 
won't crash, but let it alone. In DOMNode::textContent, 
DOMNode::getAttribute() and similar, they will be omitted. During 
importing it to another document, they will be moved without any changes.

It could be useful for editing XHTML documents. 
DOMDocument::resolveExternals is very slow. Even if DTD is on disk, it 
includes many crappy code (i.e. references to XML Schema).

-- 
Freyjkell
JID: nikn@jabber.org

---

## #32863 — Rob Richards — 2007-10-18T20:03:54+00:00

URL: https://externals.io/message/32858#32863 · In reply to: #32858

Not the place for a feature request and not going to happen. It is not 
supported in libxml2 because it is against the XML specs.

Rob

Freyjkell wrote:
> (bool) DOMDocument::keepUnknownCharacterEntities = false;
>
> If set to true (before calling DOMDocument::load() or 
> DOMDocument::loadXML()), when parser will occur an unknown entity, it 
> won't crash, but let it alone. In DOMNode::textContent, 
> DOMNode::getAttribute() and similar, they will be omitted. During 
> importing it to another document, they will be moved without any changes.
>
> It could be useful for editing XHTML documents. 
> DOMDocument::resolveExternals is very slow. Even if DTD is on disk, it 
> includes many crappy code (i.e. references to XML Schema).
