$name\n"; // print_r( $attrs); // generování proměných $xml_buffer[count($xml_buffer)+1] = array($depth[$parser],$attrs); // print_r($xml_buffer); $depth[$parser]++; } function endElement($parser, $name) { global $depth; $depth[$parser]--; } //TODO: Use '.$Config['Web']['GameVersion'].' $verze = '../source/3.3.0/FrameXML'; $files = scandir($verze); foreach ($files as $file) { $end = substr($file, strlen($file) - 3); if ($end == 'xml') { echo('
--'.$file.'

'); $file = $verze.'/'.$file; $xml_buffer = array(); //mazání $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, 'startElement', 'endElement'); if (!($fp = fopen($file, 'r'))) { die('could not open XML input'); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); for ($i = 0; $i < count($xml_buffer); $i++) { $line = $xml_buffer[$i]; if (isset($line[1]['TEXT'])) { $name = $line[1]['NAME']; if ($name == '') { //u FontString $j = 1; while (substr($name,0,1) == '') { if (isset($xml_buffer[$i-$j][1]['NAME'])) { $name = $xml_buffer[$i-$j][1]['NAME'].$name; } $j++; } } if (substr($name,0,1) == '$') { //zjišťování potomků $j = 1; while (substr($name,0,1) == '$') { if (($xml_buffer[$i-$j][0] < $line[0]) and (isset($xml_buffer[$i-$j][1]['NAME']))) { $name = substr($name,strlen('$parent')); $name = $xml_buffer[$i-$j][1]['NAME'].$name; } $j++; } } if ((' - ' <> $line[1]['TEXT']) and ('' <> $line[1]['TEXT'])) echo $name.':SetText(i["'.$line[1]['TEXT'].'"]);
'; } } } }