Beispiel #1
0
 function MakeXML()
 {
     $XmlConstruct = new \XmlConstruct('kit');
     $count = 0;
     $XmlConstruct->startElement('total_count');
     $XmlConstruct->text($this->totalCnt);
     $XmlConstruct->endElement();
     foreach ($this->postArray as $row) {
         $XmlConstruct->startElement('post');
         $XmlConstruct->startAttribute('id');
         $XmlConstruct->text($count);
         $XmlConstruct->endAttribute();
         $XmlConstruct->startElement('board_no');
         $XmlConstruct->text($row->board_no);
         $XmlConstruct->endElement();
         $XmlConstruct->startElement('module_no');
         $XmlConstruct->text($row->module_no);
         $XmlConstruct->endElement();
         $XmlConstruct->startElement('title');
         $XmlConstruct->text($row->title);
         $XmlConstruct->endElement();
         $XmlConstruct->startElement('date');
         $XmlConstruct->text($row->date);
         $XmlConstruct->endElement();
         $XmlConstruct->endElement();
         $count++;
     }
     $XmlConstruct->output($GLOBALS["RESULT_HTML_PATH"]);
 }
Beispiel #2
0
 * Time: 오후 11:06
*/
include "db_manager.php";
include 'xml_maker.php';
$db = new DBManager();
$table_name = $_GET["table"];
$file_name = $_GET["filename"];
//$total = $db->db_query2("select * from se_region_list");
$total = $db->db_query2("select * from " . $table_name);
$XmlConstruct = new XmlConstruct('table');
$count = 0;
foreach ($total as $row) {
    $XmlConstruct->startElement('row');
    $XmlConstruct->startAttribute('id');
    $XmlConstruct->text($count);
    $XmlConstruct->endAttribute();
    //echo "row[0] : ".$row[0]."          row[1] :  ".$row[1]."    row[2] :  ";
    //print_r($row);
    for ($i = 0; $i < count($row) / 2; $i++) {
        $XmlConstruct->startElement('att');
        if (!$row[$i]) {
            $XmlConstruct->text('NULL');
        } else {
            $XmlConstruct->text($row[$i]);
        }
        $XmlConstruct->endElement();
    }
    $XmlConstruct->endElement();
    $count++;
}
$file_path = "./xml/";
 function MakeXML()
 {
     $XmlConstruct = new \XmlConstruct('kit');
     $count = 0;
     if (is_null($this->files)) {
         $XmlConstruct->text("null");
     } else {
         foreach ($this->files as $row) {
             $XmlConstruct->startElement('file');
             $XmlConstruct->startAttribute('id');
             $XmlConstruct->text($count);
             $XmlConstruct->endAttribute();
             $XmlConstruct->startElement('name');
             $XmlConstruct->text($row['name']);
             $XmlConstruct->endElement();
             $XmlConstruct->startElement('url');
             $XmlConstruct->text($row['url']);
             $XmlConstruct->endElement();
             $XmlConstruct->endElement();
             $count++;
         }
     }
     $XmlConstruct->output($GLOBALS["RESULT_XML_PATH"]);
 }