コード例 #1
0
 /**
  * 生成XML信息类型列表
  * @author	肖飞
  * @param	string $strXML    请求xml字符串
  * @return  void
  */
 function makeInfoTypeListXML($strXML)
 {
     $objXML = new xml();
     $objXML->loadXML($strXML);
     $string = "//Values/*";
     $objXML->objXpath = new DOMXPath($objXML->objXML);
     $arrData = $objXML->gNodeName($string);
     $objXML = new xml();
     if ($arr = $this->getTypeList($arrData['report_type_parentid'])) {
         $root = $objXML->cElement("PHPToFlash");
         $arrReturn = array(array("Result" => "1"));
         $objXML->cElementChild("Return", $root, $arrReturn);
         foreach ($arr as $key => $val) {
             $arrReturn = array($val);
             $objXML->cElementChild("TypeList", $root, $arrReturn);
         }
         echo $objXML->saveXML();
     } else {
         $root = $objXML->cElement("ExceptionDataSet");
         $arrReturn = array(array("PKID" => "20", "Info" => "系统无法找到信息列表", "Remark" => "在请求信息列表时找不到列表"));
         $objXML->cElementChild("Exception", $root, $arrReturn);
         echo $objXML->saveXML();
     }
 }
コード例 #2
0
ファイル: check.class.php プロジェクト: TiMoChao/lc_ad_first
 /**
  * 函数名:xmlAlertExit($arrData)
  * 作 用:非法操作警告输出xml
  * @author	Arthur <*****@*****.**>
  * @param	$arrData (提示的错误信息数组)
  * @return	无
  * 备 注:无
  */
 static function xmlAlertExit($arrData)
 {
     $objXML = new xml();
     $root = $objXML->cElement("ExceptionDataSet");
     $arrReturn = array($arrData);
     $objXML->cElementChild("Exception", $root, $arrReturn);
     echo $objXML->saveXML();
     exit;
 }