Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally i managed to find the answer through DOM.</p> <p>@Deepak Srinivasan : I tried your suggestions to register the namespace before executing but i didnt get over it, may b i m not sure how to proceed.</p> <p>@m4t1t0: Thank you for your response.</p> <p>i have pasted the pastebin url of the full file, You all can see the file from the URL specified below the answer.</p> <p>I got the solution using the getAttribute method</p> <pre><code>$doc = new DOMDocument(); $doc-&gt;load( 'response1_full.xml' ); //tourname $tname = $doc-&gt;getElementsByTagName( "TourName" ); $tourname = $tname-&gt;item(0)-&gt;nodeValue; echo $tourname; //locations visited $locations = $doc-&gt;getElementsByTagName( "Location" ); foreach( $locations as $location ) { $locationname = $location-&gt;getAttribute('Name'); $locationcountry = $location-&gt;getAttribute('Country'); echo $locationname.'-'.$locationcountry.'&lt;br&gt;'; } </code></pre> <p>Which prints out the required details exactly.</p> <p>But now i have a small doubt in the same file, I have some information's in nested format, is there anyway that i can pull it easily.!?</p> <p>Here is my file for that <a href="http://pastebin.com/iWQf6j4K" rel="nofollow">http://pastebin.com/iWQf6j4K</a></p> <p>Insde the file you can see a section </p> <pre><code>&lt;ns4:WhatsIncluded&gt; </code></pre> <p>which has title and text(ul - li format)</p> <p>Is there any way i can pull the datas inside this secion. if i pull data from <strong>Text</strong> under <strong>Section</strong> i get the <em>li</em> items totally as a single paragraph,</p> <p>but when i use foreach inside <strong>Text</strong> i get only the first <em>li</em> item,</p> <p>I also tried foreach for <strong>Text</strong> <em>ul</em>, but still only one result.</p> <p>Any suggestions..</p> <p>Many thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload