note 68030 deleted from function.dom-domdocument-loadxml by nlopess
| From: | nlopess@php.net | Date: | Thu, 13 Jul 2006 19:35:53 +0000 |
| Subject: | note 68030 deleted from function.dom-domdocument-loadxml by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-114744@lists.php.net to get a copy of this message | ||
Note Submitter: daevid at daevid dot com
----
This method is kind of stupid in that if there is any leading white space before the <?xml
version='1.0'?>
like so:
<?xml version='1.0'?>
<sometag>
<anothertag>lame</anothertag>
</sometag>
it will barf with:
Warning: DOMDocument::loadXML() [function.loadXML]: XML declaration allowed only at the start of the
document in Entity, line: 1 in foo.php on line 69
To get around this annoyance, do this:
$myDOM->LoadXML(trim($xmlstring));