note 89500 added to function.simplexml-element-children

From: Date: Wed, 11 Mar 2009 12:47:26 +0000
Subject: note 89500 added to function.simplexml-element-children
Groups: php.notes 
Request: Send a blank email to php-notes+get-151719@lists.php.net to get a copy of this message
If you run into a tag that has both text and tags in it like lars dot a dot johansson, the best way to about about using that tag is to import it into dom using dom_import_simplexml(). According to http://devzone.zend.com/node/view/id/688 , simpleXML simply does not handle cases like this and will return only the tags. "The second solution is to bypass SimpleXML for certain portions of your document. One of the explicit design goals of PHP5's XML support was to allow all extensions to interoperate at a minimal cost. Since LibXML2 is the lingua franca of all XML extensions, DOM and SimpleXML objects can be exchanged with zero copies. It's just a different way of viewing the same underlying object! By this method, the DOM extension can "import" SimpleXML objects and use them as DOM objects, and vice versa. When you need to use a DOM feature you can, and when you need SimpleXML's ease of processing, you have that too." The other option in the article is to use the asXML() method and than parse the information from there. ---- Server IP: 208.69.120.35 Probable Submitter: 18.247.6.82 ---- Manual Page -- http://www.php.net/manual/en/function.simplexml-element-children.php Edit -- https://master.php.net/note/edit/89500 Del: integrated -- https://master.php.net/note/delete/89500/integrated Del: useless -- https://master.php.net/note/delete/89500/useless Del: bad code -- https://master.php.net/note/delete/89500/bad+code Del: spam -- https://master.php.net/note/delete/89500/spam Del: non-english -- https://master.php.net/note/delete/89500/non-english Del: in docs -- https://master.php.net/note/delete/89500/in+docs Del: other reasons-- https://master.php.net/note/delete/89500 Reject -- https://master.php.net/note/reject/89500 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151719) next »