Inheritance diagram for ilObjectXMLParser:
Collaboration diagram for ilObjectXMLParser:Public Member Functions | |
| ilObjectXMLParser ($a_xml_data= '', $throwException=false) | |
| Constructor. | |
| getObjectData () | |
| setHandlers ($a_xml_parser) | |
| set event handlers | |
| handlerBeginTag ($a_xml_parser, $a_name, $a_attribs) | |
| handler for begin of element | |
| handlerEndTag ($a_xml_parser, $a_name) | |
| handler for end of element | |
| handlerCharacterData ($a_xml_parser, $a_data) | |
| handler for character data | |
| __addProperty ($a_name, $a_value) | |
| __addReference ($a_value) | |
Data Fields | |
| $object_data = array() | |
Definition at line 36 of file class.ilObjectXMLParser.php.
| ilObjectXMLParser::__addProperty | ( | $ | a_name, | |
| $ | a_value | |||
| ) |
Definition at line 192 of file class.ilObjectXMLParser.php.
Referenced by handlerBeginTag(), and handlerEndTag().
{
$this->object_data[$this->curr_obj][$a_name] = $a_value;
}
Here is the caller graph for this function:| ilObjectXMLParser::__addReference | ( | $ | a_value | ) |
Definition at line 197 of file class.ilObjectXMLParser.php.
Referenced by handlerEndTag().
{
if($a_value)
{
$this->object_data[$this->curr_obj]['references'][] = $a_value;
}
}
Here is the caller graph for this function:| ilObjectXMLParser::getObjectData | ( | ) |
Definition at line 55 of file class.ilObjectXMLParser.php.
{
return $this->object_data ? $this->object_data : array();
}
| ilObjectXMLParser::handlerBeginTag | ( | $ | a_xml_parser, | |
| $ | a_name, | |||
| $ | a_attribs | |||
| ) |
handler for begin of element
| resource | $a_xml_parser xml parser | |
| string | $a_name element name | |
| array | $a_attribs element attributes array |
Definition at line 83 of file class.ilObjectXMLParser.php.
References __addProperty(), and ilUtil::__extractId().
{
switch($a_name)
{
case 'Objects':
$this->curr_obj = -1;
break;
case 'Object':
++$this->curr_obj;
$this->__addProperty('type',$a_attribs['type']);
$this->__addProperty('obj_id',is_numeric($a_attribs['obj_id'])?(int) $a_attribs["obj_id"] : ilUtil::__extractId($a_attribs["obj_id"], IL_INST_ID));
break;
case 'Title':
break;
case 'Description':
break;
case 'Owner':
break;
case 'CreateDate':
break;
case 'LastUpdate':
break;
case 'ImportId':
break;
case 'References':
$this->ref_id = $a_attribs["ref_id"];
break;
}
}
Here is the call graph for this function:| ilObjectXMLParser::handlerCharacterData | ( | $ | a_xml_parser, | |
| $ | a_data | |||
| ) |
handler for character data
| resource | $a_xml_parser xml parser | |
| string | $a_data character data |
Definition at line 178 of file class.ilObjectXMLParser.php.
{
if($a_data != "\n")
{
// Replace multiple tabs with one space
$a_data = preg_replace("/\t+/"," ",$a_data);
$this->cdata .= $a_data;
}
}
| ilObjectXMLParser::handlerEndTag | ( | $ | a_xml_parser, | |
| $ | a_name | |||
| ) |
handler for end of element
| resource | $a_xml_parser xml parser | |
| string | $a_name element name |
Definition at line 128 of file class.ilObjectXMLParser.php.
References __addProperty(), and __addReference().
{
switch($a_name)
{
case 'Objects':
break;
case 'Object':
break;
case 'Title':
$this->__addProperty('title',trim($this->cdata));
break;
case 'Description':
$this->__addProperty('description',trim($this->cdata));
break;
case 'Owner':
$this->__addProperty('owner',trim($this->cdata));
break;
case 'CreateDate':
$this->__addProperty('create_date',trim($this->cdata));
break;
case 'LastUpdate':
$this->__addProperty('last_update',trim($this->cdata));
break;
case 'ImportId':
$this->__addProperty('import_id',trim($this->cdata));
break;
case 'References':
$this->__addReference($this->ref_id);
break;
}
$this->cdata = '';
return;
}
Here is the call graph for this function:| ilObjectXMLParser::ilObjectXMLParser | ( | $ | a_xml_data = '', |
|
| $ | throwException = false | |||
| ) |
Constructor.
| object | $a_content_object must be of type ilObjContentObject ilObjTest or ilObjQuestionPool | |
| string | $a_xml_file xml data | |
| string | $a_subdir subdirectory in import directory public |
Definition at line 49 of file class.ilObjectXMLParser.php.
References ilSaxParser::$throwException, ilSaxParser::ilSaxParser(), and ilSaxParser::setXMLContent().
{
parent::ilSaxParser('', $throwException);
$this->setXMLContent($a_xml_data);
}
Here is the call graph for this function:| ilObjectXMLParser::setHandlers | ( | $ | a_xml_parser | ) |
set event handlers
| resource | reference to the xml parser private |
Reimplemented from ilSaxParser.
Definition at line 66 of file class.ilObjectXMLParser.php.
{
xml_set_object($a_xml_parser,$this);
xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
}
| ilObjectXMLParser::$object_data = array() |
Definition at line 38 of file class.ilObjectXMLParser.php.
1.7.1