Im am trying to count the nodes in my XML document so I can specify in the loop where I dont want <hr>'s i.e. at the end of the page.
Please tell me why this is not counting the nodes under blog.
foreach(file_counter("blog/$current_year/$months") as $key=>$file)
{
$doc = new DOMDocument();
$doc->load($file);
$dataset = $doc->getElementsByTagName("blog");
$node_count = $dataset->length;
$i = 0;
foreach($dataset as $row)
{
$title = $row->getElementsByTagName("title")->item(0)->nodeValue;
$date = $row->getElementsByTagName("date")->item(0)->nodeValue;
$body = $row->getElementsByTagName("body")->item(0)->nodeValue;
$i++;
echo "$title<br>";
echo "$date<br>";
echo "$body<br><br>";
echo $node_count;
}
}