diff --git a/application/default/controllers/HeiheController.php b/application/default/controllers/HeiheController.php index 37601fd4..43f8a30e 100644 --- a/application/default/controllers/HeiheController.php +++ b/application/default/controllers/HeiheController.php @@ -487,7 +487,17 @@ class HeiheController extends DataController return true; }else{ $uuid = $row['uuid']; - } + } + + //检查元数据错误 + $iso=new ISO19115(); + @$iso->loadXML($row['data']); + if ($iso->validate()) + { + $data=array("error"=>"元数据导入过程中发现错误。
".implode("
",$iso->error)); + $this->jsonexit($data); + return true; + } $messages = array(); @@ -566,8 +576,7 @@ class HeiheController extends DataController // 3. 保存数据评审状态 //导入元数据 - $iso=new ISO19115(); - $iso->saveDB($this->db,$row['xml']); + $iso->saveDB($this->db); //进入评审库 $sql="insert into mdstatus (uuid,status,userid) values(?,?,?)"; $this->db->query($sql,array($uuid,0,$u_id));