) $bookmark = false; $open_tags = array( 'OPML' => '', 'HEAD' => '', 'TITLE' => '', 'BODY' => '<BODY>', 'OUTLINE' => '<OUTLINE>', ); $close_tags = array( 'OPML' => '</OPML>', 'HEAD' => '</HEAD>', 'TITLE' => '', 'BODY' => '', 'OUTLINE' => '', ); function startElement($parser, $name, $attrs) { global $open_tags, $current_tag, $folder, $bookmark; $current_tag = $name; switch($name) { case 'OUTLINE': if (empty($attrs['XMLURL'])) { #start of folder $h = min($folder,6); ?>
  • >> \n
  • \n"; } break; default: break; } $bookmark = false; } $xml_parser = xml_parser_create($type); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true); xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen($file, "r") or die("could not open XML input " . $file); print "

    updated: ". date("d M Y h:m:s T",filemtime($file)); print "\n\n"; ?>