note 126774 added to function.simplexml-load-file

From: Date: Tue, 18 Jan 2022 02:49:18 +0000
Subject: note 126774 added to function.simplexml-load-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-217510@lists.php.net to get a copy of this message
This may sometimes get missed, but if your xml nodes are in the format: <prefix:element /> You need to make sure to set the [namespace or prefix] argument and the [isPrefix] argument to true. Also when recalling elements you need to avoid adding the prefix if that is already set, so in the above example "prefix:element" should be added as "element" but when saved the prefix will be added automatically. If prefix is not set during load or object construction, load will fail to get the nodes correctly and you will not be able to recall elements directly so $xml->{'prefix:element'} will not work either. ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.135 (proxied: 165.225.208.255) ---- Manual Page -- https://php.net/manual/en/function.simplexml-load-file.php Edit -- https://main.php.net/note/edit/126774 Del: integrated -- https://main.php.net/note/delete/126774/integrated Del: useless -- https://main.php.net/note/delete/126774/useless Del: bad code -- https://main.php.net/note/delete/126774/bad+code Del: spam -- https://main.php.net/note/delete/126774/spam Del: non-english -- https://main.php.net/note/delete/126774/non-english Del: in docs -- https://main.php.net/note/delete/126774/in+docs Del: other reasons-- https://main.php.net/note/delete/126774 Reject -- https://main.php.net/note/reject/126774 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#217510) next »