note 11233 deleted from function.xml-parse-into-struct by sniper
| From: | sniper@php.net | Date: | Fri, 05 Dec 2003 00:32:20 +0000 |
| Subject: | note 11233 deleted from function.xml-parse-into-struct by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61422@lists.php.net to get a copy of this message | ||
Note Submitter: nyk@cowham.net
----
The code submitted by gdemartini@bol.com.br is generally quite useful. However, it only creates a
tree from elements and attributes and not the cdata enclosed by elements. Any cdata is lost. If you
want to capture cdata then you need to modify the switch statement for case 'complete'
thus:
...
case 'complete':
array_push($children, array('tag' => $vals[$i]['tag'],
'attributes' => $vals[$i]['attributes'], 'value' =>
$vals[$i]['value']));
break;
...
Adding the map, 'value' => $vals[$i]['value'] to the array will make the
original code more complete.