Go to the documentation of this file.00001 <?php
00002 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDSaxParser.php';
00003
00004 class ilMDXMLParser extends ilMDSaxParser
00005 {
00006
00007
00008
00009
00010
00011
00012 function ilMDXMLParser($content,$a_obj_id,$a_rbac_id,$a_type)
00013 {
00014
00015 $this->setMDObject(new ilMD($a_obj_id,$a_rbac_id,$a_type));
00016
00017
00018 #parent::ilMDSaxParser($content);
00019
00020
00021 parent::ilMDSaxParser();
00022 $this->setXMLContent($content);
00023
00024 }
00025 function setHandlers($a_xml_parser)
00026 {
00027 xml_set_object($a_xml_parser,$this);
00028 xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
00029 xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
00030 }
00031
00032 function handlerBeginTag($a_xml_parser,$a_name,$a_attribs)
00033 {
00034 if($this->in_meta_data)
00035 {
00036 parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
00037 return true;
00038 }
00039
00040
00041 switch($a_name)
00042 {
00043 case 'MetaData':
00044 $this->in_meta_data = true;
00045 parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
00046 return true;
00047
00048 default:
00049
00050 }
00051 }
00052 function handlerEndTag($a_xml_parser,$a_name)
00053 {
00054 if($this->in_meta_data)
00055 {
00056 parent::handlerEndTag($a_xml_parser,$a_name);
00057 return true;
00058 }
00059 switch($a_name)
00060 {
00061 case 'MetaData':
00062 $this->in_meta_data = false;
00063 parent::handlerEndTag($a_xml_parser,$a_name);
00064 return true;
00065
00066 default:
00067
00068 }
00069 }
00070
00071 function handlerCharacterData($a_xml_parser,$a_data)
00072 {
00073 if($this->in_meta_data)
00074 {
00075 parent::handlerCharacterData($a_xml_parser,$a_data);
00076 return true;
00077 }
00078 }
00079
00080
00081
00082 }
00083 ?>