'DateFormat','TIMEFORMAT'=>'TimeFormat', 'DECIMAL'=>'Decimal','THOUSANDS'=>'Thousands', 'CHARSET'=>'Charset'); $fp = fopen(SRC_NAME,'r'); $xml = fread($fp,filesize(SRC_NAME)); fclose($fp); $objInXML = new xml_doc($xml); unset($xml); $objInXML->parse(); $objInXML->getTag(0,$name,$attribs,$contents,$tags); $fp=fopen(DST_NAME,'w'); foreach($tags as $t) { $LangRoot =& $objInXML->getTagByID($t); fwrite($fp,'PackName='.$LangRoot->attributes['PACKNAME']."\n"); foreach($LangRoot->children as $tag) { switch($tag->name) { case 'PHRASES': $tag_index = 0; $tag_count = count($tag->children); while($tag_index < $tag_count) { $inner_tag =& $tag->children[$tag_index]; $Phrase = $inner_tag->attributes['LABEL']; $Translation = $inner_tag->contents; $PhraseType = $inner_tag->attributes['TYPE']; fwrite($fp,'P_='.$Phrase.';'.$Translation.';'.$PhraseType."\n"); $tag_index++; } break; case 'EVENTS': $tag_index = 0; $tag_count = count($tag->children); while($tag_index < $tag_count) { $inner_tag =& $tag->children[$tag_index]; $event = $inner_tag->attributes["EVENT"]; $MsgType = strtolower($inner_tag->attributes["MESSAGETYPE"]); $template = $inner_tag->contents; $Type = $inner_tag->attributes["TYPE"]; fwrite($fp,'E_='.$event.';'.$template.';'.$Type.';'.$MsgType."\n"); $tag_index++; } break; default: fwrite($fp,$xml2txt_map[$tag->name].'='.base64_encode($tag->contents)."\n"); break; } } } fclose($fp); ?>