"; printf("

%s

", // make our title into an actual link trim($link),htmlspecialchars(trim($title))); // remove html characters from the title echo ""; echo " "; printf("

%s

",$description); // Print out the live journal entry echo""; echo ""; echo ""; echo "
"; $title = $description = $link = $insideitem = false; } } // Now to the parsing itself. Starts by creating it: $xml_parser = xml_parser_create(); // Then setup the handlers: xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); // Open the actual datafile: $fp = fopen($backend, r); // Run through it line by line and parse: while ($data = fread($fp, 4096)) { xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } // Close the datafile fclose($fp); // Free any memmory used xml_parser_free($xml_parser); ?>