note 84905 added to domdocument.validate

From: Date: Tue, 05 Aug 2008 14:19:13 +0000
Subject: note 84905 added to domdocument.validate
Groups: php.notes 
Request: Send a blank email to php-notes+get-143163@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: 196.25.255.214 ---- Manual Page -- http://www.php.net/manual/en/domdocument.validate.php Edit -- https://master.php.net/note/edit/84905 Del: integrated -- https://master.php.net/note/delete/84905/integrated Del: useless -- https://master.php.net/note/delete/84905/useless Del: bad code -- https://master.php.net/note/delete/84905/bad+code Del: spam -- https://master.php.net/note/delete/84905/spam Del: non-english -- https://master.php.net/note/delete/84905/non-english Del: in docs -- https://master.php.net/note/delete/84905/in+docs Del: other reasons-- https://master.php.net/note/delete/84905 Reject -- https://master.php.net/note/reject/84905 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143163) next »