$struct = new OutlineFromJSON($_REQUEST['data']); } //end switch TRUE if ($_REQUEST['urlfill']) { $struct->toOPMLfields(); $struct->fillURLs(); } //if urlfill, then ensure xml and html URLs by calling ->fillURLs. The toOPMLfields is not necessary but helps fillURLs do it's job easier. if ($_REQUEST['output'] == 'opml') { //output OPML header('Content-Type: application/xml;charset=utf-8'); //send the XML http header $struct->toOPMLfields(); //convert fields to standard OPML field names if ($_REQUEST['simplify']) { $struct->simplify(); } //if we're simplifying, do so echo $struct->toOPML(); //echo the OPML code for the object exit; //we're done } //end if output == opml if ($_REQUEST['output'] == 'xoxo') { //output XOXO if (count($classes) < 1) { $classes = array('xoxo'); } //If we were not passed classes, output has default class of 'xoxo' header('Content-Type: application/xml;charset=utf-8');