Page 1 of 1

xml_parse_into_struct function to determine tag path

Posted: Tue Mar 30, 2004 11:10 am
by yaron
Hell all,

I'm using xml_parse_into_struct to parse an xml file.
What I want to do is to to get the tag path for each value in the xml file.
this is what i use to get the path

Code: Select all

<?php
if($item['type'] == "open" || $item['type'] == "complete")
	array_push($tags, $item['tag']);

?>
This is working fine but I need to pop the last value in the $tags array when I see type close like this:

Code: Select all

<?php
if($item['type'] == "close")
   array_pop($tags);
?>
This part doesn't work and I keep adding tags to the array and not popping them when one closes.
any ideas?

Posted: Tue Mar 30, 2004 8:20 pm
by Weirdan
It would be useful to see more code.