Presentation Materials

parser = xml_parser_create('UTF-8'); xml_set_object($this->parser, $this); xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1); xml_set_element_handler($this->parser, 'tag_open', 'tag_close'); xml_set_character_data_handler($this->parser, 'cdata'); if (!($fp = fopen($path,"r"))){ die("Cannot open XML data File : $path"); return false; } $data = ""; while ($tmp = fread($fp,4096)){ $data = $data . $tmp; } fclose($fp); if (!xml_parse($this->parser, $data)) { $this->data = array(); $this->error_code = xml_get_error_code($this->parser); $this->error_string = xml_error_string($this->error_code); $this->current_line = xml_get_current_line_number($this->parser); $this->current_column = xml_get_current_column_number($this->parser); } else { $this->data = $this->data['child']; } xml_parser_free($this->parser); } function tag_open($parser, $tag, $attribs) { $this->data['child'][$tag][] = array('data' => '', 'attribs' => $attribs, 'child' => array()); $this->datas[] =& $this->data; $this->data =& $this->data['child'][$tag][count($this->data['child'][$tag])-1]; } function cdata($parser, $cdata) { $this->data['data'] .= $cdata; } function tag_close($parser, $tag) { $this->data =& $this->datas[count($this->datas)-1]; array_pop($this->datas); } } function print_table($items) { $n = count($items); print "\n"; print "\n"; for($i=0;$i<$n;$i++){ $item = $items[$i]; $child = $item['child']; $id = $child['ID'][0]['data']; $name = $child['NAME'][0]['data']; $title = $child['TITLE'][0]['data']; $aff = $child['AFFILIATION'][0]['data']; $file = $child['FILE'][0]['data']; if ( $i % 2 == 0 ) $class = 'oddrow'; else $class = 'evenrow'; if ( $file != '' ){ print "\n"; }else{ print "\n"; } } print "
No.Name/AffiliationTitle
$id$name
$aff
$title
$id$name
$aff
$title
\n"; } $xml_parser = new Simple_Parser; print "

Invited & Oral

"; $xml_parser->parse('oral.xml'); $items = $xml_parser->data['LIST'][0]['child']['ITEM']; print_table($items); print "

Poster 1

"; $xml_parser->parse('poster1.xml'); $items = $xml_parser->data['LIST'][0]['child']['ITEM']; print_table($items); print "

Poster 2

"; $xml_parser->parse('poster2.xml'); $items = $xml_parser->data['LIST'][0]['child']['ITEM']; print_table($items); ?>