title: How to display an annotated image out of the xml file using the DOM XML parsing using php?
body: <pre><code>&lt;surface&gt;  
      &lt;graphic url="Z:\home\ashutosh\Desktop\imgdone\0015 Dalai       Lama\0001.jpeg" width="208px" height="242px"/&gt;
      &lt;zone xml:id="imtArea_0" rendition="_0015" ulx="47" uly="68" lrx="143" lry="172" rend="visible"/&gt;
  
  &lt;/surface&gt;
  </code></pre>
  
  <p>My objective is to load the image given by the url attribute of graphic and get it annotated by the coordinates given as ulx, uly, lrx and lry. When I run the above the code below, I get graphic as a child node of surface but I am not able to get as to how to extract the image from the url which is the attribute of the graphic.</p>
  
  <p>Therefore, firstly can someone tell me how to load the image from the given url using the DOM parsing and secondly when my image gets displayed, how can I draw a bounding box around the face of the image using the coordinates ulx, uly....lry. </p>
  
  <p>Edited, I think this will help understanding the question</p>
  
  <p>Please help !!</p>
  
  <pre><code>&lt;?php
  
  $xmlDoc = new DOMDocument();
  $xmlDoc-&gt;load("0001.xml");
  
  $elements = $xmlDoc-&gt;getElementsByTagName('surface');
  foreach ($elements as $node) 
  {
       if($node-&gt;childNodes-&gt;length)
       {
          foreach($node-&gt;childNodes as $child)
  {   
          echo $child-&gt;nodeName,',';
          echo $child-&gt;nodeName,','-&gt;nodeValue;
  }   
  
    }
  
   }
  ?&gt;
  </code></pre>