<surface>
<graphic url="Z:\home\ashutosh\Desktop\imgdone\0015 Dalai Lama\0001.jpeg" width="208px" height="242px"/>
<zone xml:id="imtArea_0" rendition="_0015" ulx="47" uly="68" lrx="143" lry="172" rend="visible"/>
</surface>
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.
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.
Edited, I think this will help understanding the question
Please help !!
<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("0001.xml");
$elements = $xmlDoc->getElementsByTagName('surface');
foreach ($elements as $node)
{
if($node->childNodes->length)
{
foreach($node->childNodes as $child)
{
echo $child->nodeName,',';
echo $child->nodeName,','->nodeValue;
}
}
}
?>