note 84904 added to domdocument.load
| From: | darren at viamedia dot co dot za | Date: | Tue, 05 Aug 2008 14:17:35 +0000 |
| Subject: | note 84904 added to domdocument.load | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143162@lists.php.net to get a copy of this message | ||
If you are loading xml with the intention of validating it against an internal dtd and you have
experienced issues with the validation it could be related to missing LIBXML constants.
I found this post by "aidan at php dot net" in root level dom docs and thought it might be
more useful here:
As of PHP 5.1, libxml options may be set using constants rather than the use of proprietary
DomDocument properties.
DomDocument->resolveExternals is equivilant to setting
LIBXML_DTDLOAD
LIBXML_DTDATTR
DomDocument->validateOnParse is equivilant to setting
LIBXML_DTDLOAD
LIBXML_DTDVALID
PHP 5.1 users are encouraged to use the new constants.
Example:
<?php
$dom = new DOMDocument;
// Resolve externals
$dom->load($file, LIBXML_DTDLOAD|LIBXML_DTDATTR);
// OR
// Validate against DTD
$dom->load($file, LIBXML_DTDLOAD|LIBXML_DTDVALID);
$dom->validate();
?>
----
Server IP: 69.147.83.197
Probable Submitter: 198.54.202.214
----
Manual Page -- http://www.php.net/manual/en/domdocument.load.php
Edit -- https://master.php.net/note/edit/84904
Del: integrated -- https://master.php.net/note/delete/84904/integrated
Del: useless -- https://master.php.net/note/delete/84904/useless
Del: bad code -- https://master.php.net/note/delete/84904/bad+code
Del: spam -- https://master.php.net/note/delete/84904/spam
Del: non-english -- https://master.php.net/note/delete/84904/non-english
Del: in docs -- https://master.php.net/note/delete/84904/in+docs
Del: other reasons-- https://master.php.net/note/delete/84904
Reject -- https://master.php.net/note/reject/84904
Search -- https://master.php.net/manage/user-notes.php