ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDSaxParser Class Reference
+ Inheritance diagram for ilMDSaxParser:
+ Collaboration diagram for ilMDSaxParser:

Public Member Functions

 ilMDSaxParser ($a_xml_file= '')
 Constructor.
 enableMDParsing ($a_status)
 getMDParsingStatus ()
 setMDObject (&$md)
getMDObject ()
 inMetaData ()
 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
 __getCharacterData ()
 __pushParent (&$md_obj)
__popParent ()
__getParent ()
 ilMDSaxParser ($a_xml_file= '')
 Constructor.
 setMDObject (&$md)
 inMetaData ()
 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
 __getCharacterData ()
 __pushParent (&$md_obj)
__popParent ()
__getParent ()
- Public Member Functions inherited from ilSaxParser
 ilSaxParser ($a_xml_file= '', $throwException=false)
 Constructor setup ILIAS global object public.
 setXMLContent ($a_xml_content)
 getXMLContent ()
 getInputType ()
 startParsing ()
 stores xml data in array
 createParser ()
 create parser
 setOptions ($a_xml_parser)
 set parser options
 openXMLFile ()
 open xml file
 parse ($a_xml_parser, $a_fp=null)
 parse xml file
 freeParser ($a_xml_parser)
 free xml parser handle
 setThrowException ($throwException)
 set error handling
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor.
 _PEAR ()
 Destructor (the emulated type of...).
getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them.
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes.
 isError ($data, $code=null)
 Tell whether a value is a PEAR error.
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled.
 expectError ($code= '*')
 This method is used to tell which errors you expect to get.
 popExpect ()
 This method pops one element off the expected error codes stack.
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available.
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack.
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied.
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options.
 staticPushErrorHandling ($mode, $options=null)
 staticPopErrorHandling ()
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack.
 popErrorHandling ()
 Pop the last error handler used.
 loadExtension ($ext)
 OS independant PHP extension load.

Data Fields

 $md_in_md = false
 $md_chr_data = ''
 $md_cur_el = null
 $md_parsing_enabled = null
 $md = null
 $md_gen
- Data Fields inherited from ilSaxParser
 $input_type = null
 $xml_content = ''
 $ilias
 $lng
 $xml_file
 $throwException = false
- Data Fields inherited from PEAR
 $_debug = false
 $_default_error_mode = null
 $_default_error_options = null
 $_default_error_handler = ''
 $_error_class = 'PEAR_Error'
 $_expected_errors = array()

Additional Inherited Members

- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle

Detailed Description

Definition at line 39 of file class.ilMDSaxParser.php.

Member Function Documentation

ilMDSaxParser::__getCharacterData ( )

Definition at line 618 of file class.ilMDSaxParser.php.

{
return trim($this->md_chr_data);
}
ilMDSaxParser::__getCharacterData ( )

Definition at line 668 of file class.ilMDSaxParser.php.

Referenced by handlerEndTag().

{
return trim($this->md_chr_data);
}

+ Here is the caller graph for this function:

& ilMDSaxParser::__getParent ( )

Definition at line 638 of file class.ilMDSaxParser.php.

{
return $this->md_parent[count($this->md_parent) - 1];
}
& ilMDSaxParser::__getParent ( )

Definition at line 688 of file class.ilMDSaxParser.php.

Referenced by ilMDXMLCopier\handlerBeginTag(), handlerBeginTag(), ilMDXMLCopier\handlerEndTag(), and handlerEndTag().

{
return $this->md_parent[count($this->md_parent) - 1];
}

+ Here is the caller graph for this function:

& ilMDSaxParser::__popParent ( )

Definition at line 632 of file class.ilMDSaxParser.php.

{
$class =& array_pop($this->md_parent);
unset($class);
#echo '<br />Popped '.get_class($class);
}
& ilMDSaxParser::__popParent ( )

Definition at line 682 of file class.ilMDSaxParser.php.

Referenced by ilMDXMLCopier\handlerEndTag(), and handlerEndTag().

{
$class = array_pop($this->md_parent);
unset($class);
#echo '<br />DELETE '.get_class($class);
}

+ Here is the caller graph for this function:

ilMDSaxParser::__pushParent ( $md_obj)

Definition at line 623 of file class.ilMDSaxParser.php.

{
$this->md_parent[] =& $md_obj;
#echo '<br />';
foreach($this->md_parent as $class)
{
#echo get_class($class).' -> ';
}
}
ilMDSaxParser::__pushParent ( $md_obj)

Definition at line 673 of file class.ilMDSaxParser.php.

Referenced by ilMDXMLCopier\handlerBeginTag(), and handlerBeginTag().

{
$this->md_parent[] =& $md_obj;
#echo '<br />';
foreach($this->md_parent as $class)
{
#echo get_class($class).' -> ';
}
}

+ Here is the caller graph for this function:

ilMDSaxParser::enableMDParsing (   $a_status)

Definition at line 77 of file class.ilMDSaxParser.php.

Referenced by ilContObjParser\handlerBeginTag(), and ilContObjParser\handlerEndTag().

{
$this->md_parsing_enabled = (bool) $a_status;
}

+ Here is the caller graph for this function:

& ilMDSaxParser::getMDObject ( )

Definition at line 90 of file class.ilMDSaxParser.php.

{
return is_object($this->md) ? $this->md : false;
}
ilMDSaxParser::getMDParsingStatus ( )

Definition at line 81 of file class.ilMDSaxParser.php.

References $md_parsing_enabled.

Referenced by handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

{
}

+ Here is the caller graph for this function:

ilMDSaxParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 83 of file class.ilMDSaxParser.php.

References __getParent(), and __pushParent().

{
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
switch($a_name)
{
case 'MetaData':
$this->md_in_md = true;
$this->__pushParent($this->md);
break;
case 'General':
$this->md_gen =& $this->md->addGeneral();
$this->md_gen->setStructure($a_attribs['Structure']);
$this->md_gen->save();
$this->__pushParent($this->md_gen);
break;
case 'Identifier':
$par =& $this->__getParent();
$this->md_ide =& $par->addIdentifier();
$this->md_ide->setCatalog($a_attribs['Catalog']);
$this->md_ide->setEntry($a_attribs['Entry']);
$this->md_ide->save();
$this->__pushParent($this->md_ide);
break;
case 'Title':
$par =& $this->__getParent();
$par->setTitleLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Language':
$par =& $this->__getParent();
$this->md_lan =& $par->addLanguage();
$this->md_lan->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_lan->save();
$this->__pushParent($this->md_lan);
break;
case 'Description':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmdrights' or
strtolower(get_class($par)) == 'ilmdannotation' or
strtolower(get_class($par)) == 'ilmdclassification')
{
$par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
}
else
{
$this->md_des =& $par->addDescription();
$this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_des->save();
$this->__pushParent($this->md_des);
break;
}
case 'Keyword':
$par =& $this->__getParent();
$this->md_key =& $par->addKeyword();
$this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_key->save();
$this->__pushParent($this->md_key);
break;
case 'Coverage':
$par =& $this->__getParent();
$par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Lifecycle':
$par =& $this->__getParent();
$this->md_lif =& $par->addLifecycle();
$this->md_lif->setStatus($a_attribs['Status']);
$this->md_lif->save();
$this->__pushParent($this->md_lif);
break;
case 'Version':
$par =& $this->__getParent();
$par->setVersionLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Contribute':
$par =& $this->__getParent();
$this->md_con =& $par->addContribute();
$this->md_con->setRole($a_attribs['Role']);
$this->md_con->save();
$this->__pushParent($this->md_con);
break;
case 'Entity':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmdcontribute')
{
$this->md_ent =& $par->addEntity();
$this->md_ent->save();
$this->__pushParent($this->md_ent);
break;
}
else
{
// single element in 'Annotation'
break;
}
case 'Date':
break;
case 'Meta-Metadata':
$par =& $this->__getParent();
$this->md_met =& $par->addMetaMetadata();
$this->md_met->setMetaDataScheme($a_attribs['MetadataScheme']);
$this->md_met->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_met->save();
$this->__pushParent($this->md_met);
break;
case 'Technical':
$par =& $this->__getParent();
$this->md_tec =& $par->addTechnical();
$this->md_tec->save();
$this->__pushParent($this->md_tec);
break;
case 'Format':
$par =& $this->__getParent();
$this->md_for =& $par->addFormat();
$this->md_for->save();
$this->__pushParent($this->md_for);
break;
case 'Size':
break;
case 'Location':
$par =& $this->__getParent();
$this->md_loc =& $par->addLocation();
$this->md_loc->setLocationType($a_attribs['Type']);
$this->md_loc->save();
$this->__pushParent($this->md_loc);
break;
case 'Requirement':
$par =& $this->__getParent();
$this->md_req =& $par->addRequirement();
$this->md_req->save();
$this->__pushParent($this->md_req);
break;
case 'OrComposite':
$par =& $this->__getParent();
$this->md_orc =& $par->addOrComposite();
$this->__pushParent($this->md_orc);
break;
case 'Type':
break;
case 'OperatingSystem':
$par =& $this->__getParent();
$par->setOperatingSystemName($a_attribs['Name']);
$par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion']);
$par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion']);
break;
case 'Browser':
$par =& $this->__getParent();
$par->setBrowserName($a_attribs['Name']);
$par->setBrowserMinimumVersion($a_attribs['MinimumVersion']);
$par->setBrowserMaximumVersion($a_attribs['MaximumVersion']);
break;
case 'InstallationRemarks':
$par =& $this->__getParent();
$par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'OtherPlatformRequirements':
$par =& $this->__getParent();
$par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Duration':
break;
case 'Educational':
$par =& $this->__getParent();
$this->md_edu =& $par->addEducational();
$this->md_edu->setInteractivityType($a_attribs['InteractivityType']);
$this->md_edu->setLearningResourceType($a_attribs['LearningResourceType']);
$this->md_edu->setInteractivityLevel($a_attribs['InteractivityLevel']);
$this->md_edu->setSemanticDensity($a_attribs['SemanticDensity']);
$this->md_edu->setIntendedEndUserRole($a_attribs['IntendedEndUserRole']);
$this->md_edu->setContext($a_attribs['Context']);
$this->md_edu->setDifficulty($a_attribs['Difficulty']);
$this->md_edu->save();
$this->__pushParent($this->md_edu);
break;
case 'TypicalAgeRange':
$par =& $this->__getParent();
$this->md_typ =& $par->addTypicalAgeRange();
$this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_typ->save();
$this->__pushParent($this->md_typ);
break;
case 'TypicalLearningTime':
break;
case 'Rights':
$par =& $this->__getParent();
$this->md_rig =& $par->addRights();
$this->md_rig->setCosts($a_attribs['Costs']);
$this->md_rig->setCopyrightAndOtherRestrictions($a_attribs['CopyrightAndOtherRestrictions']);
$this->md_rig->save();
$this->__pushParent($this->md_rig);
break;
case 'Relation':
$par =& $this->__getParent();
$this->md_rel =& $par->addRelation();
$this->md_rel->setKind($a_attribs['Kind']);
$this->md_rel->save();
$this->__pushParent($this->md_rel);
break;
case 'Resource':
break;
case 'Identifier_':
$par =& $this->__getParent();
$this->md_ide_ =& $par->addIdentifier_();
$this->md_ide_->setCatalog($a_attribs['Catalog']);
$this->md_ide_->setEntry($a_attribs['Entry']);
$this->md_ide_->save();
$this->__pushParent($this->md_ide_);
break;
case 'Annotation':
$par =& $this->__getParent();
$this->md_ann =& $par->addAnnotation();
$this->md_ann->save();
$this->__pushParent($this->md_ann);
break;
case 'Classification':
$par =& $this->__getParent();
$this->md_cla =& $par->addClassification();
$this->md_cla->setPurpose($a_attribs['Purpose']);
$this->md_cla->save();
$this->__pushParent($this->md_cla);
break;
case 'TaxonPath':
$par =& $this->__getParent();
$this->md_taxp =& $par->addTaxonPath();
$this->md_taxp->save();
$this->__pushParent($this->md_taxp);
break;
case 'Source':
$par =& $this->__getParent();
$par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Taxon':
$par =& $this->__getParent();
$this->md_tax =& $par->addTaxon();
$this->md_tax->setTaxonLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_tax->setTaxonId($a_attribs['Id']);
$this->md_tax->save();
$this->__pushParent($this->md_tax);
break;
}
}

+ Here is the call graph for this function:

ilMDSaxParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 118 of file class.ilMDSaxParser.php.

References __getParent(), __pushParent(), and getMDParsingStatus().

{
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
if(!$this->getMDParsingStatus())
{
return;
}
switch($a_name)
{
case 'MetaData':
$this->md_in_md = true;
$this->__pushParent($this->md);
break;
case 'General':
$this->md_gen =& $this->md->addGeneral();
$this->md_gen->setStructure($a_attribs['Structure']);
$this->md_gen->save();
$this->__pushParent($this->md_gen);
break;
case 'Identifier':
$par =& $this->__getParent();
$this->md_ide =& $par->addIdentifier();
$this->md_ide->setCatalog($a_attribs['Catalog']);
$this->md_ide->setEntry($a_attribs['Entry']);
$this->md_ide->save();
$this->__pushParent($this->md_ide);
break;
case 'Title':
$par =& $this->__getParent();
$par->setTitleLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Language':
$par =& $this->__getParent();
$this->md_lan =& $par->addLanguage();
$this->md_lan->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_lan->save();
$this->__pushParent($this->md_lan);
break;
case 'Description':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmdrights' or
strtolower(get_class($par)) == 'ilmdannotation' or
strtolower(get_class($par)) == 'ilmdclassification')
{
$par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
}
else
{
$this->md_des =& $par->addDescription();
$this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_des->save();
$this->__pushParent($this->md_des);
break;
}
case 'Keyword':
$par =& $this->__getParent();
$this->md_key =& $par->addKeyword();
$this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_key->save();
$this->__pushParent($this->md_key);
break;
case 'Coverage':
$par =& $this->__getParent();
$par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Lifecycle':
$par =& $this->__getParent();
$this->md_lif =& $par->addLifecycle();
$this->md_lif->setStatus($a_attribs['Status']);
$this->md_lif->save();
$this->__pushParent($this->md_lif);
break;
case 'Version':
$par =& $this->__getParent();
$par->setVersionLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Contribute':
$par =& $this->__getParent();
$this->md_con =& $par->addContribute();
$this->md_con->setRole($a_attribs['Role']);
$this->md_con->save();
$this->__pushParent($this->md_con);
break;
case 'Entity':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmdcontribute')
{
$this->md_ent =& $par->addEntity();
$this->md_ent->save();
$this->__pushParent($this->md_ent);
break;
}
else
{
// single element in 'Annotation'
break;
}
case 'Date':
break;
case 'Meta-Metadata':
$par =& $this->__getParent();
$this->md_met =& $par->addMetaMetadata();
$this->md_met->setMetaDataScheme($a_attribs['MetadataScheme']);
$this->md_met->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_met->save();
$this->__pushParent($this->md_met);
break;
case 'Technical':
$par =& $this->__getParent();
$this->md_tec =& $par->addTechnical();
$this->md_tec->save();
$this->__pushParent($this->md_tec);
break;
case 'Format':
$par =& $this->__getParent();
$this->md_for =& $par->addFormat();
$this->md_for->save();
$this->__pushParent($this->md_for);
break;
case 'Size':
break;
case 'Location':
$par =& $this->__getParent();
$this->md_loc =& $par->addLocation();
$this->md_loc->setLocationType($a_attribs['Type']);
$this->md_loc->save();
$this->__pushParent($this->md_loc);
break;
case 'Requirement':
$par =& $this->__getParent();
$this->md_req =& $par->addRequirement();
$this->md_req->save();
$this->__pushParent($this->md_req);
break;
case 'OrComposite':
$par =& $this->__getParent();
$this->md_orc =& $par->addOrComposite();
$this->__pushParent($this->md_orc);
break;
case 'Type':
break;
case 'OperatingSystem':
$par =& $this->__getParent();
$par->setOperatingSystemName($a_attribs['Name']);
$par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion']);
$par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion']);
break;
case 'Browser':
$par =& $this->__getParent();
$par->setBrowserName($a_attribs['Name']);
$par->setBrowserMinimumVersion($a_attribs['MinimumVersion']);
$par->setBrowserMaximumVersion($a_attribs['MaximumVersion']);
break;
case 'InstallationRemarks':
$par =& $this->__getParent();
$par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'OtherPlatformRequirements':
$par =& $this->__getParent();
$par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Duration':
break;
case 'Educational':
$par =& $this->__getParent();
$this->md_edu =& $par->addEducational();
$this->md_edu->setInteractivityType($a_attribs['InteractivityType']);
$this->md_edu->setLearningResourceType($a_attribs['LearningResourceType']);
$this->md_edu->setInteractivityLevel($a_attribs['InteractivityLevel']);
$this->md_edu->setSemanticDensity($a_attribs['SemanticDensity']);
$this->md_edu->setIntendedEndUserRole($a_attribs['IntendedEndUserRole']);
$this->md_edu->setContext($a_attribs['Context']);
$this->md_edu->setDifficulty($a_attribs['Difficulty']);
$this->md_edu->save();
$this->__pushParent($this->md_edu);
break;
case 'TypicalAgeRange':
$par =& $this->__getParent();
$this->md_typ =& $par->addTypicalAgeRange();
$this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_typ->save();
$this->__pushParent($this->md_typ);
break;
case 'TypicalLearningTime':
break;
case 'Rights':
$par =& $this->__getParent();
$this->md_rig =& $par->addRights();
$this->md_rig->setCosts($a_attribs['Costs']);
$this->md_rig->setCopyrightAndOtherRestrictions($a_attribs['CopyrightAndOtherRestrictions']);
$this->md_rig->save();
$this->__pushParent($this->md_rig);
break;
case 'Relation':
$par =& $this->__getParent();
$this->md_rel =& $par->addRelation();
$this->md_rel->setKind($a_attribs['Kind']);
$this->md_rel->save();
$this->__pushParent($this->md_rel);
break;
case 'Resource':
break;
case 'Identifier_':
$par =& $this->__getParent();
$this->md_ide_ =& $par->addIdentifier_();
$this->md_ide_->setCatalog($a_attribs['Catalog']);
$this->md_ide_->setEntry($a_attribs['Entry']);
$this->md_ide_->save();
$this->__pushParent($this->md_ide_);
break;
case 'Annotation':
$par =& $this->__getParent();
$this->md_ann =& $par->addAnnotation();
$this->md_ann->save();
$this->__pushParent($this->md_ann);
break;
case 'Classification':
$par =& $this->__getParent();
$this->md_cla =& $par->addClassification();
$this->md_cla->setPurpose($a_attribs['Purpose']);
$this->md_cla->save();
$this->__pushParent($this->md_cla);
break;
case 'TaxonPath':
$par =& $this->__getParent();
$this->md_taxp =& $par->addTaxonPath();
$this->md_taxp->save();
$this->__pushParent($this->md_taxp);
break;
case 'Source':
$par =& $this->__getParent();
$par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language']));
break;
case 'Taxon':
$par =& $this->__getParent();
$this->md_tax =& $par->addTaxon();
$this->md_tax->setTaxonLanguage(new ilMDLanguageItem($a_attribs['Language']));
$this->md_tax->setTaxonId($a_attribs['Id']);
$this->md_tax->save();
$this->__pushParent($this->md_tax);
break;
}
}

+ Here is the call graph for this function:

ilMDSaxParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 604 of file class.ilMDSaxParser.php.

References inMetaData().

{
if ($this->inMetaData() and $a_data != "\n")
{
// Replace multiple tabs with one space
$a_data = preg_replace("/\t+/"," ",$a_data);
$this->md_chr_data .= $a_data;
}
}

+ Here is the call graph for this function:

ilMDSaxParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 649 of file class.ilMDSaxParser.php.

References getMDParsingStatus(), and inMetaData().

{
if(!$this->getMDParsingStatus())
{
return;
}
if ($this->inMetaData() and $a_data != "\n")
{
// Replace multiple tabs with one space
$a_data = preg_replace("/\t+/"," ",$a_data);
$this->md_chr_data .= $a_data;
}
}

+ Here is the call graph for this function:

ilMDSaxParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 366 of file class.ilMDSaxParser.php.

References __getCharacterData(), __getParent(), and __popParent().

{
switch($a_name)
{
case 'MetaData':
$this->md_parent = array();
$this->md_in_md = false;
break;
case 'General':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Identifier':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Title':
$par =& $this->__getParent();
$par->setTitle($this->__getCharacterData());
break;
case 'Language':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Description':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmddescription')
{
$par->setDescription($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
}
else
{
$par->setDescription($this->__getCharacterData());
break;
}
case 'Keyword':
$par =& $this->__getParent();
$par->setKeyword($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Coverage':
$par =& $this->__getParent();
$par->setCoverage($this->__getCharacterData());
break;
case 'Lifecycle':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Version':
$par =& $this->__getParent();
$par->setVersion($this->__getCharacterData());
break;
case 'Contribute':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Entity':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmdentity')
{
$par->setEntity($this->__getCharacterData());
$par->update();
$this->__popParent();
}
else
{
// Single element in 'Annotation'
$par->setEntity($this->__getCharacterData());
}
break;
case 'Date':
$par =& $this->__getParent();
$par->setDate($this->__getCharacterData());
break;
case 'Meta-Metadata':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Technical':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Format':
$par =& $this->__getParent();
$par->setFormat($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Size':
$par =& $this->__getParent();
$par->setSize($this->__getCharacterData());
break;
case 'Location':
$par =& $this->__getParent();
$par->setLocation($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Requirement':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'OrComposite':
$this->__popParent();
break;
case 'Type':
break;
case 'OperatingSystem':
break;
case 'Browser':
break;
case 'InstallationRemarks':
$par =& $this->__getParent();
$par->setInstallationRemarks($this->__getCharacterData());
break;
case 'OtherPlatformRequirements':
$par =& $this->__getParent();
$par->setOtherPlatformRequirements($this->__getCharacterData());
break;
case 'Duration':
$par =& $this->__getParent();
$par->setDuration($this->__getCharacterData());
break;
case 'Educational':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'TypicalAgeRange':
$par =& $this->__getParent();
$par->setTypicalAgeRange($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'TypicalLearningTime':
$par =& $this->__getParent();
$par->setTypicalLearningTime($this->__getCharacterData());
break;
case 'Rights':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Relation':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Resource':
break;
case 'Identifier_':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Annotation':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Classification':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'TaxonPath':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Taxon':
$par =& $this->__getParent();
$par->setTaxon($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Source':
$par =& $this->__getParent();
$par->setSource($this->__getCharacterData());
break;
}
$this->md_chr_data = '';
}

+ Here is the call graph for this function:

ilMDSaxParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 406 of file class.ilMDSaxParser.php.

References __getCharacterData(), __getParent(), __popParent(), and getMDParsingStatus().

{
if(!$this->getMDParsingStatus())
{
return;
}
switch($a_name)
{
case 'MetaData':
$this->md_parent = array();
$this->md_in_md = false;
break;
case 'General':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Identifier':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Title':
$par =& $this->__getParent();
$par->setTitle($this->__getCharacterData());
break;
case 'Language':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Description':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmddescription')
{
$par->setDescription($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
}
else
{
$par->setDescription($this->__getCharacterData());
break;
}
case 'Keyword':
$par =& $this->__getParent();
$par->setKeyword($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Coverage':
$par =& $this->__getParent();
$par->setCoverage($this->__getCharacterData());
break;
case 'Lifecycle':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Version':
$par =& $this->__getParent();
$par->setVersion($this->__getCharacterData());
break;
case 'Contribute':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Entity':
$par =& $this->__getParent();
if(strtolower(get_class($par)) == 'ilmdentity')
{
$par->setEntity($this->__getCharacterData());
$par->update();
$this->__popParent();
}
else
{
// Single element in 'Annotation'
$par->setEntity($this->__getCharacterData());
}
break;
case 'Date':
$par =& $this->__getParent();
$par->setDate($this->__getCharacterData());
break;
case 'Meta-Metadata':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Technical':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Format':
$par =& $this->__getParent();
$par->setFormat($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Size':
$par =& $this->__getParent();
$par->setSize($this->__getCharacterData());
break;
case 'Location':
$par =& $this->__getParent();
$par->setLocation($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Requirement':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'OrComposite':
$this->__popParent();
break;
case 'Type':
break;
case 'OperatingSystem':
break;
case 'Browser':
break;
case 'InstallationRemarks':
$par =& $this->__getParent();
$par->setInstallationRemarks($this->__getCharacterData());
break;
case 'OtherPlatformRequirements':
$par =& $this->__getParent();
$par->setOtherPlatformRequirements($this->__getCharacterData());
break;
case 'Duration':
$par =& $this->__getParent();
$par->setDuration($this->__getCharacterData());
break;
case 'Educational':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'TypicalAgeRange':
$par =& $this->__getParent();
$par->setTypicalAgeRange($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'TypicalLearningTime':
$par =& $this->__getParent();
$par->setTypicalLearningTime($this->__getCharacterData());
break;
case 'Rights':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Relation':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Resource':
break;
case 'Identifier_':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Annotation':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Classification':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'TaxonPath':
$par =& $this->__getParent();
$par->update();
$this->__popParent();
break;
case 'Taxon':
$par =& $this->__getParent();
$par->setTaxon($this->__getCharacterData());
$par->update();
$this->__popParent();
break;
case 'Source':
$par =& $this->__getParent();
$par->setSource($this->__getCharacterData());
break;
}
$this->md_chr_data = '';
}

+ Here is the call graph for this function:

ilMDSaxParser::ilMDSaxParser (   $a_xml_file = '')

Constructor.

public

Definition at line 62 of file class.ilMDSaxParser.php.

References ilSaxParser\$lng, and ilSaxParser\ilSaxParser().

{
global $lng, $tree;
parent::ilSaxParser($a_xml_file);
}

+ Here is the call graph for this function:

ilMDSaxParser::ilMDSaxParser (   $a_xml_file = '')

Constructor.

public

Definition at line 66 of file class.ilMDSaxParser.php.

References ilSaxParser\$lng, and ilSaxParser\ilSaxParser().

Referenced by ilContObjParser\ilContObjParser(), ilCourseXMLParser\ilCourseXMLParser(), ilMDXMLCopier\ilMDXMLCopier(), and ilMDXMLParser\ilMDXMLParser().

{
global $lng, $tree;
// Enable parsing. E.g qpl' s will set this value to false
$this->md_parsing_enabled = true;
parent::ilSaxParser($a_xml_file);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDSaxParser::inMetaData ( )

Definition at line 74 of file class.ilMDSaxParser.php.

References $md_in_md.

{
}
ilMDSaxParser::inMetaData ( )

Definition at line 95 of file class.ilMDSaxParser.php.

References $md_in_md.

Referenced by handlerCharacterData().

{
}

+ Here is the caller graph for this function:

ilMDSaxParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser private

Reimplemented from ilSaxParser.

Reimplemented in ilContObjParser, ilCourseXMLParser, ilMDXMLCopier, and ilMDXMLParser.

Definition at line 106 of file class.ilMDSaxParser.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');
}
ilMDSaxParser::setMDObject ( $md)

Definition at line 69 of file class.ilMDSaxParser.php.

References $md.

{
$this->md =& $md;
}
ilMDSaxParser::setMDObject ( $md)

Definition at line 86 of file class.ilMDSaxParser.php.

References $md.

Referenced by ilCourseXMLParser\ilCourseXMLParser(), ilMDXMLCopier\ilMDXMLCopier(), and ilMDXMLParser\ilMDXMLParser().

{
$this->md =& $md;
}

+ Here is the caller graph for this function:

Field Documentation

ilMDSaxParser::$md = null

Definition at line 53 of file class.ilMDSaxParser.php.

Referenced by setMDObject().

ilMDSaxParser::$md_chr_data = ''

Definition at line 42 of file class.ilMDSaxParser.php.

ilMDSaxParser::$md_cur_el = null

Definition at line 44 of file class.ilMDSaxParser.php.

ilMDSaxParser::$md_gen

Definition at line 58 of file class.ilMDSaxParser.php.

ilMDSaxParser::$md_in_md = false

Definition at line 41 of file class.ilMDSaxParser.php.

Referenced by inMetaData().

ilMDSaxParser::$md_parsing_enabled = null

Definition at line 49 of file class.ilMDSaxParser.php.

Referenced by getMDParsingStatus().


The documentation for this class was generated from the following files: