ballhogjoni Posted July 19, 2007 Share Posted July 19, 2007 How can I take the php output of XML and parse it to html? This is my php xml code: <?php $file = "sitemap.xml"; function contents($parser, $data){ echo $data; } function startTag($parser, $data){ echo "<b>"; } function endTag($parser, $data){ echo "</b><br />"; } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startTag", "endTag"); xml_set_character_data_handler($xml_parser, "contents"); $fp = fopen($file, "r"); $data = fread($fp, 80000); if(!(xml_parse($xml_parser, $data, feof($fp)))){ die("Error on line " . xml_get_current_line_number($xml_parser)); } xml_parser_free($xml_parser); fclose($fp); ?> and it puts out: http://xxxx.com/123.php 2007-07-19T12:04:03-05:00 weekly 0.5 http://xxxx.com/1234.php 2007-07-19T12:04:03-05:00 weekly 0.5 My question is, is how do I turn the URL's above to a link to that specific page? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.