note 46782 added to function.dom-domdocument-loadxml

From: Date: Sat, 23 Oct 2004 02:13:47 +0000
Subject: note 46782 added to function.dom-domdocument-loadxml
Groups: php.notes 
Request: Send a blank email to php-notes+get-78965@lists.php.net to get a copy of this message
Here are the five options you can set before a load() or loadXML() to affect the way a document loads. validateOnParse - will load and validate against DTD default FALSE resolveExternals - will load the DTD without performaing validation default FALSE preserveWhiteSpace - do not remove redundant white space default TRUE substituteEntities - convert named character entities to numeric entities default FALSE strictErrorChecking - throw exceptions on Errors default TRUE If you do not specify validateOnParse=TRUE or resolveExternals=TRUE then most named entities will be lost on load. If this happens a Warning will be logged. A few entities like & will work either way. If you specify one of those TRUE, and leave substituteEntities=FALSE then the named entities will be passed though unchanged. If instead you set substituteEntities=TRUE then the named entities will be converted to numeric entities. I have local XML catalogs set up, but validateOnParse and resolveExternals create a huge performance penalty for me. Five, ten or twenty times performance loss. There should be a way to tell load() to accept named entities verbatim without the penalty of loading the DTD. strictErrorChecking does not seem to change how PHP 5 handles a load. Errors wil always abort the load(). This only turns throwing exceptions on and off. ---- Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-loadxml.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46782 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46782&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46782&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46782&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46782&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46782&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46782&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46782&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78965) next »