get xml child node data in php -


any idea how data of node <ns2:profilematchdetailscore> in php have trying code

$xml_document = simplexml_load_xml($xml_document); 

$foo_ns_bar = $xml_document->children('http://example.com'); echo $foo_ns_bar->bar[0]; // prints 'baz'

but thats not working on end.

<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body>     <ns2:matchresponse xmlns:ns2="http://xmp.actonomy.com">         <return>             <matchcount>1</matchcount>             <fromhits>0</fromhits>             <maxhits>10</maxhits>             <matches>                 <detailscore>                     <score>0.41281393</score>                     <contributedscore>0.41281393</contributedscore>                     <maxcontributedscore>1.0</maxcontributedscore>                     <weight>1.0</weight>                     <occur>must</occur>                     <ns2:profilematchdetailscore>                         <score>0.41281393</score>                         <contributedscore>0.41281393</contributedscore>                         <maxcontributedscore>1.0</maxcontributedscore>                         <weight>1.0</weight>                         <occur>should</occur>                         <ns2:termgroupdetailscore>                             <score>0.94805205</score><contributedscore>0.2528139</contributedscore>                                <maxcontributedscore>0.2666667</maxcontributedscore>                            <weight>1.0</weight>                             <occur>must</occur>                             <name>job_title</name>                             <ns2:termdetailscore>                                 <score>0.909091</score><contributedscore>0.13852817</contributedscore>                                    <maxcontributedscore>0.15238099</maxcontributedscore>                             </ns2:termdetailscore>                         </ns2:termgroupdetailscore>                     </ns2:profilematchdetailscore>                 </detailscore>             </matches>         </return>     </ns2:matchresponse> </soap:body> 


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -