Thank you very much for your reply. But, its not working with my XML file.
This is my current script, where I am able to get all images on a single line.
$objDOM = new DOMDocument();
$params = $objDOM->getElementsByTagName("image");
foreach( $params as $picture )
$theurl = $picture -> getAttribute('url');
echo "$theurl ";
now I could also get the images that should be there for that node.
if you see my XML file which I have posted
Hence when the loop starts I could get the total images in that particular <userimages> section and break my statement, when that total is reached.
Thats where I am stuck. I am not able to pass the total and apply a break statement where by it ends the function there and then again searches in the XML for the next <userimages> tag..in a loop
Finally there is one more difference in the file you have created and the file I have.
My data starts with
<mainnode> and ends with </mainnode>
while ur xml starts with
<user> and ends with </user>
Secondly My code does not use the
tag ... it starts with userimages directly...