note 89823 added to function.simplexml-element-children

From: Date: Tue, 24 Mar 2009 21:02:03 +0000
Subject: note 89823 added to function.simplexml-element-children
Groups: php.notes 
Request: Send a blank email to php-notes+get-152404@lists.php.net to get a copy of this message
Has anybody solved problems loading NS Formatted XML's ??? I've been struggling even with latest php with xml formats like : <tns:control> <tns:code_part>01234</tns:code_part> <tns:code_m>test</tns:code_m> <tns:type_operation>ident</tns:type_operation> <tns:num_session>0123456789</siv:num_session> <tns:date>2001-12-31T12:00:00</siv:date> </tns:control> or like : <tns:test> <test_Dem xmlns:lns="http://url" xsi:type="lns:test_Dem" id="id24"> <test_Dem_Cont xmlns:lns="http://url" xsi:type="lns:test_Dem_Cont" id="id24"> <ID>2</ID> <test_Cont xmlns:lns="//url" xsd:type="lns:test_Cont" href="#id25"/> </test_Dem_Cont> </test_Dem> </tns:DA> <test_Cont xmlns:lns="http://url" xsi:type="lns:test_Cont" id="id25"> <CI>1122233</CI> <CI_2>13545646546</CI_2> </test_Cont> Those tns semi-colons prevent parsing correctly xml... Only solution found : Replacing XML Source, by removing semi-colons, before parsing via simple XML... $data = preg_replace('|<([/\w]+)(:)|m','<$1',$postdata); $data = preg_replace('|(\w+)(:)(\w+=\")|m','$1$3',$data); It may help several to find more easily solution to parsing for example soap messages through SimpleXML (even if and i agree there are soap functions in PHP) ---- Server IP: 89.31.146.176 Probable Submitter: 92.135.139.150 ---- Manual Page -- http://www.php.net/manual/en/function.simplexml-element-children.php Edit -- https://master.php.net/note/edit/89823 Del: integrated -- https://master.php.net/note/delete/89823/integrated Del: useless -- https://master.php.net/note/delete/89823/useless Del: bad code -- https://master.php.net/note/delete/89823/bad+code Del: spam -- https://master.php.net/note/delete/89823/spam Del: non-english -- https://master.php.net/note/delete/89823/non-english Del: in docs -- https://master.php.net/note/delete/89823/in+docs Del: other reasons-- https://master.php.net/note/delete/89823 Reject -- https://master.php.net/note/reject/89823 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152404) next »