with my code I am trying to grab the path data from a xml (used to be svg) file and while I am able to successfully print out the data by the $attributes array, using echo it still pulls up the "call to a member function attributes() on a non-object in (line 136 and 156) I simply don t see what is wrong with the code, although worst case scenario I can always use a hack around that inserts the selected data into a db within the while loop and upon iteration forward to the desired page... I am wondering what exactly is wrong with my code. it echos out the correct information with the echo commands. it just still gives the call to a member function on a non object error
while($number_of_array_path >=1)
{
//declares attributes based on path number for sodipodi attributes line136
$attributes = $xml_file_open->g->path[$path_incremental_counter]-
>attributes( sodipodi , true);
//sets each attribute within an array and uses the path incremental counter for
//that pourpose.
$type_array[$path_incremental_counter] = $attributes[ type ];
$cx_array[$path_incremental_counter] = $attributes[ cx ];
$cy_array[$path_incremental_counter] = $attributes[ cy ];
$rx_array[$path_incremental_counter] = $attributes[ rx ];
$ry_array[$path_incremental_counter] = $attributes[ ry ];
echo $type_array[$path_incremental_counter];
echo "<br/>";
echo $cx_array[$path_incremental_counter];
echo "<br/>";
echo $cy_array[$path_incremental_counter];
echo "<br/>";
echo $rx_array[$path_incremental_counter];
echo "<br/>";
echo $ry_array[$path_incremental_counter];
echo "<br/>";
//same as above but for non"sodipodi" attributes. line 156
$attributes = $xml_file_open->g->path[$path_incremental_counter]->attributes();
// echo $attributes[ id ];
$style_array[$path_incremental_counter] = $attributes[ style ];
$id_array[$path_incremental_counter] = $attributes[ id ];
$d_array[$path_incremental_counter] = $attributes[ d ];
echo $style_array[$path_incremental_counter];
echo "<br/>";
echo $id_array[$path_incremental_counter];
echo "<br/>";
echo $d_array[$path_incremental_counter];
echo "<br/>";
//increments path incremental counter
$path_incremental_counter = $path_incremental_counter + 1;
//decrements number of array path
$number_of_array_path = $number_of_array_path;
}