ILIAS  release_8 Revision v8.24
ilMDSaxParser Class Reference
+ Inheritance diagram for ilMDSaxParser:
+ Collaboration diagram for ilMDSaxParser:

Public Member Functions

 __construct (?string $a_xml_file='')
 
 enableMDParsing (bool $a_status)
 
 getMDParsingStatus ()
 
 setMDObject (ilMD $md)
 
 getMDObject ()
 
 inMetaData ()
 
 setHandlers ($a_xml_parser)
 Set event handlers. More...
 
 handlerBeginTag ($a_xml_parser, string $a_name, array $a_attribs)
 
 handlerEndTag ($a_xml_parser, string $a_name)
 
 handlerCharacterData ($a_xml_parser, string $a_data)
 
 __getCharacterData ()
 
 __pushParent (object $md_obj)
 
 __popParent ()
 
 __getParent ()
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Protected Member Functions

 trimAndStripAttribs (array $attribs)
 
 trimAndStrip (string $input)
 
- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 

Protected Attributes

bool $md_in_md = false
 
string $md_chr_data = ''
 
ilMDIdentifier $md_ide = null
 
ilMDLanguage $md_lan = null
 
ilMDDescription $md_des = null
 
ilMDLifecycle $md_lif = null
 
ilMDContribute $md_con = null
 
ilMDEntity $md_ent = null
 
ilMDMetaMetadata $md_met = null
 
ilMDTechnical $md_tec = null
 
ilMDFormat $md_for = null
 
ilMDLocation $md_loc = null
 
ilMDRequirement $md_req = null
 
ilMDOrComposite $md_orc = null
 
ilMDEducational $md_edu = null
 
ilMDTypicalAgeRange $md_typ = null
 
ilMDRights $md_rig = null
 
ilMDRelation $md_rel = null
 
ilMDIdentifier_ $md_ide_ = null
 
ilMDAnnotation $md_ann = null
 
ilMDClassification $md_cla = null
 
ilMDTaxonPath $md_taxp = null
 
ilMDTaxon $md_tax = null
 
ilMDKeyword $md_key = null
 
array $md_parent = array()
 
ilMD $md = null
 
ilMDGeneral $md_gen = null
 
ilLogger $meta_log
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Private Attributes

bool $md_parsing_enabled
 

Additional Inherited Members

- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMDSaxParser::__construct ( ?string  $a_xml_file = '')

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

71 {
72 global $DIC;
73
74 $this->meta_log = $DIC->logger()->meta();
75
76 // Enable parsing. E.g qpl' s will set this value to false
77 $this->md_parsing_enabled = true;
78
79 parent::__construct($a_xml_file);
80 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ __getCharacterData()

ilMDSaxParser::__getCharacterData ( )

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

660 : string
661 {
662 return $this->trimAndStrip($this->md_chr_data);
663 }
trimAndStrip(string $input)

References trimAndStrip().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getParent()

ilMDSaxParser::__getParent ( )

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

685 : object
686 {
687 return $this->md_parent[count($this->md_parent) - 1];
688 }

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

+ Here is the caller graph for this function:

◆ __popParent()

ilMDSaxParser::__popParent ( )

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

674 : void
675 {
676 $this->meta_log->debug('New parent stack (pop)....');
677 $class = array_pop($this->md_parent);
678 foreach ((array) $this->md_parent as $class) {
679 $this->meta_log->debug(get_class($class));
680 }
681 $this->meta_log->debug(is_object($class) ? get_class($class) : 'null');
682 unset($class);
683 }

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

+ Here is the caller graph for this function:

◆ __pushParent()

ilMDSaxParser::__pushParent ( object  $md_obj)

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

665 : void
666 {
667 $this->md_parent[] = &$md_obj;
668 $this->meta_log->debug('New parent stack (push)...');
669 foreach ($this->md_parent as $class) {
670 $this->meta_log->debug(get_class($class));
671 }
672 }

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

+ Here is the caller graph for this function:

◆ enableMDParsing()

ilMDSaxParser::enableMDParsing ( bool  $a_status)

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

82 : void
83 {
84 $this->md_parsing_enabled = $a_status;
85 }

◆ getMDObject()

ilMDSaxParser::getMDObject ( )

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

97 : ?ilMD
98 {
99 return is_object($this->md) ? $this->md : null;
100 }

Referenced by ilSCORM13MDImporter\import(), ilCourseXMLParser\startParsing(), ilGroupXMLParser\startParsing(), ilWebLinkXmlParser\startParsing(), and ilMDXMLCopier\startParsing().

+ Here is the caller graph for this function:

◆ getMDParsingStatus()

ilMDSaxParser::getMDParsingStatus ( )

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

87 : bool
88 {
90 }

References $md_parsing_enabled.

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

+ Here is the caller graph for this function:

◆ handlerBeginTag()

ilMDSaxParser::handlerBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
XMLParser | resource$a_xml_parser

Reimplemented in ilWebLinkXmlParser, ilCourseXMLParser, ilGroupXMLParser, ilSCORM13MDImporter, ilAdvancedMDParser, and ilMDXMLCopier.

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

121 : void
122 {
123 $a_attribs = $this->trimAndStripAttribs($a_attribs);
124 if (!$this->getMDParsingStatus()) {
125 return;
126 }
127
128 switch ($a_name) {
129 case 'MetaData':
130 $this->md_in_md = true;
131 $this->__pushParent($this->md);
132 break;
133
134 case 'General':
135 $this->md_gen = $this->md->addGeneral();
136 $this->md_gen->setStructure($a_attribs['Structure'] ?? '');
137 $this->md_gen->save();
138 $this->__pushParent($this->md_gen);
139 break;
140
141 case 'Identifier':
142 $par = $this->__getParent();
143 $this->md_ide = $par->addIdentifier();
144 $this->md_ide->setCatalog($a_attribs['Catalog'] ?? '');
145 $this->md_ide->setEntry($a_attribs['Entry'] ?? '');
146 $this->md_ide->save();
147 $this->__pushParent($this->md_ide);
148 break;
149
150 case 'Title':
151 $par = $this->__getParent();
152 $par->setTitleLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
153 break;
154
155 case 'Language':
156 $par = $this->__getParent();
157 $this->md_lan = $par->addLanguage();
158 $this->md_lan->setLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
159 $this->md_lan->save();
160 $this->__pushParent($this->md_lan);
161 break;
162
163 case 'Description':
164 $par = $this->__getParent();
165
166 if (strtolower(get_class($par)) === 'ilmdrights' ||
167 strtolower(get_class($par)) === 'ilmdannotation' ||
168 strtolower(get_class($par)) === 'ilmdclassification') {
169 $par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
170 break;
171 } else {
172 $this->md_des = $par->addDescription();
173 $this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
174 $this->md_des->save();
175 $this->__pushParent($this->md_des);
176 break;
177 }
178
179 // no break
180 case 'Keyword':
181 $par = $this->__getParent();
182 if (!$par instanceof ilMD) {
183 $this->md_key = $par->addKeyword();
184 $this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
185 $this->md_key->save();
186 $this->__pushParent($this->md_key);
187 }
188 break;
189
190 case 'Coverage':
191 $par = $this->__getParent();
192 $par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
193 break;
194
195 case 'Lifecycle':
196 $par = $this->__getParent();
197 $this->md_lif = $par->addLifecycle();
198 $this->md_lif->setStatus($a_attribs['Status'] ?? '');
199 $this->md_lif->save();
200 $this->__pushParent($this->md_lif);
201 break;
202
203 case 'Version':
204 $par = $this->__getParent();
205 $par->setVersionLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
206 break;
207
208 case 'Contribute':
209 $par = $this->__getParent();
210 $this->md_con = $par->addContribute();
211 $this->md_con->setRole($a_attribs['Role'] ?? '');
212 $this->md_con->save();
213 $this->__pushParent($this->md_con);
214 break;
215
216 case 'Entity':
217 $par = $this->__getParent();
218
219 if (strtolower(get_class($par)) === 'ilmdcontribute') {
220 $this->md_ent = $par->addEntity();
221 $this->md_ent->save();
222 $this->__pushParent($this->md_ent);
223 break;
224 } else {
225 // single element in 'Annotation'
226 break;
227 }
228 // no break
229 case 'Date':
230 break;
231
232 case 'Meta-Metadata':
233 $par = $this->__getParent();
234 $this->md_met = $par->addMetaMetadata();
235 $this->md_met->setMetaDataScheme($a_attribs['MetadataScheme'] ?? '');
236 $this->md_met->setLanguage(new ilMDLanguageItem((string) ($a_attribs['Language'] ?? "")));
237 $this->md_met->save();
238 $this->__pushParent($this->md_met);
239 break;
240
241 case 'Technical':
242 $par = $this->__getParent();
243 $this->md_tec = $par->addTechnical();
244 $this->md_tec->save();
245 $this->__pushParent($this->md_tec);
246 break;
247
248 case 'Format':
249 $par = $this->__getParent();
250 $this->md_for = $par->addFormat();
251 $this->md_for->save();
252 $this->__pushParent($this->md_for);
253 break;
254
255 case 'Size':
256 break;
257
258 case 'Location':
259 $par = $this->__getParent();
260 $this->md_loc = $par->addLocation();
261 $this->md_loc->setLocationType($a_attribs['Type'] ?? '');
262 $this->md_loc->save();
263 $this->__pushParent($this->md_loc);
264 break;
265
266 case 'Requirement':
267 $par = $this->__getParent();
268 $this->md_req = $par->addRequirement();
269 $this->md_req->save();
270 $this->__pushParent($this->md_req);
271 break;
272
273 case 'OrComposite':
274 $par = $this->__getParent();
275 $this->md_orc = $par->addOrComposite();
276 $this->__pushParent($this->md_orc);
277 break;
278
279 case 'Type':
280 break;
281
282 case 'OperatingSystem':
283 $par = $this->__getParent();
284 $par->setOperatingSystemName($a_attribs['Name'] ?? '');
285 $par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion'] ?? '');
286 $par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion'] ?? '');
287 break;
288
289 case 'Browser':
290 $par = $this->__getParent();
291 $par->setBrowserName($a_attribs['Name'] ?? '');
292 $par->setBrowserMinimumVersion($a_attribs['MinimumVersion'] ?? '');
293 $par->setBrowserMaximumVersion($a_attribs['MaximumVersion'] ?? '');
294 break;
295
296 case 'InstallationRemarks':
297 $par = $this->__getParent();
298 $par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
299 break;
300
301 case 'OtherPlatformRequirements':
302 $par = $this->__getParent();
303 $par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
304 break;
305
306 case 'Duration':
307 break;
308
309 case 'Educational':
310 $par = $this->__getParent();
311 $this->md_edu = $par->addEducational();
312 $this->md_edu->setInteractivityType($a_attribs['InteractivityType'] ?? '');
313 $this->md_edu->setLearningResourceType($a_attribs['LearningResourceType'] ?? '');
314 $this->md_edu->setInteractivityLevel($a_attribs['InteractivityLevel'] ?? '');
315 $this->md_edu->setSemanticDensity($a_attribs['SemanticDensity'] ?? '');
316 $this->md_edu->setIntendedEndUserRole($a_attribs['IntendedEndUserRole'] ?? '');
317 $this->md_edu->setContext($a_attribs['Context'] ?? '');
318 $this->md_edu->setDifficulty($a_attribs['Difficulty'] ?? '');
319 $this->md_edu->save();
320 $this->__pushParent($this->md_edu);
321 break;
322
323 case 'TypicalAgeRange':
324 $par = $this->__getParent();
325 $this->md_typ = $par->addTypicalAgeRange();
326 $this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
327 $this->md_typ->save();
328 $this->__pushParent($this->md_typ);
329 break;
330
331 case 'TypicalLearningTime':
332 break;
333
334 case 'Rights':
335 $par = $this->__getParent();
336 $this->md_rig = $par->addRights();
337 $this->md_rig->setCosts($a_attribs['Cost'] ?? '');
338 $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs['CopyrightAndOtherRestrictions'] ?? '');
339 $this->md_rig->save();
340 $this->__pushParent($this->md_rig);
341 break;
342
343 case 'Relation':
344 $par = $this->__getParent();
345 $this->md_rel = $par->addRelation();
346 $this->md_rel->setKind($a_attribs['Kind'] ?? '');
347 $this->md_rel->save();
348 $this->__pushParent($this->md_rel);
349 break;
350
351 case 'Resource':
352 break;
353
354 case 'Identifier_':
355 $par = $this->__getParent();
356 $this->md_ide_ = $par->addIdentifier_();
357 $this->md_ide_->setCatalog($a_attribs['Catalog'] ?? '');
358 $this->md_ide_->setEntry($a_attribs['Entry'] ?? '');
359 $this->md_ide_->save();
360 $this->__pushParent($this->md_ide_);
361 break;
362
363 case 'Annotation':
364 $par = $this->__getParent();
365 $this->md_ann = $par->addAnnotation();
366 $this->md_ann->save();
367 $this->__pushParent($this->md_ann);
368 break;
369
370 case 'Classification':
371 $par = $this->__getParent();
372 $this->md_cla = $par->addClassification();
373 $this->md_cla->setPurpose($a_attribs['Purpose'] ?? '');
374 $this->md_cla->save();
375 $this->__pushParent($this->md_cla);
376 break;
377
378 case 'TaxonPath':
379 $par = $this->__getParent();
380 $this->md_taxp = $par->addTaxonPath();
381 $this->md_taxp->save();
382 $this->__pushParent($this->md_taxp);
383 break;
384
385 case 'Source':
386 $par = $this->__getParent();
387 $par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
388 break;
389
390 case 'Taxon':
391 $par = $this->__getParent();
392 $this->md_tax = $par->addTaxon();
393 $this->md_tax->setTaxonLanguage(new ilMDLanguageItem($a_attribs['Language'] ?? ''));
394 $this->md_tax->setTaxonId($a_attribs['Id'] ?? '');
395 $this->md_tax->save();
396 $this->__pushParent($this->md_tax);
397 break;
398 }
399 }
__pushParent(object $md_obj)
trimAndStripAttribs(array $attribs)

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

+ Here is the call graph for this function:

◆ handlerCharacterData()

ilMDSaxParser::handlerCharacterData (   $a_xml_parser,
string  $a_data 
)
Parameters
resource$a_xml_parser

Reimplemented in ilCourseXMLParser, ilGroupXMLParser, ilQuestionPageParser, ilWebLinkXmlParser, ilAdvancedMDParser, and ilMDXMLCopier.

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

645 : void
646 {
647 if (!$this->getMDParsingStatus()) {
648 return;
649 }
650
651 if ($a_data !== "\n" && $this->inMetaData()) {
652 // Replace multiple tabs with one space
653 $a_data = preg_replace("/\t+/", " ", $a_data);
654
655 $this->md_chr_data .= $a_data;
656 }
657 }

References getMDParsingStatus(), and inMetaData().

+ Here is the call graph for this function:

◆ handlerEndTag()

ilMDSaxParser::handlerEndTag (   $a_xml_parser,
string  $a_name 
)
Parameters
resource$a_xml_parser

Reimplemented in ilCourseXMLParser, ilGroupXMLParser, ilSCORM13MDImporter, ilQuestionPageParser, ilWebLinkXmlParser, ilAdvancedMDParser, and ilMDXMLCopier.

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

404 : void
405 {
406 if (!$this->getMDParsingStatus()) {
407 return;
408 }
409
410 switch ($a_name) {
411 case 'MetaData':
412 $this->md_parent = array();
413 $this->md_in_md = false;
414 break;
415
416 case 'General':
417 $par = $this->__getParent();
418 $par->update();
419 $this->__popParent();
420 break;
421
422 case 'Identifier':
423 $par = $this->__getParent();
424 $par->update();
425 $this->__popParent();
426 break;
427
428 case 'Title':
429 $par = $this->__getParent();
430 $par->setTitle($this->__getCharacterData());
431 break;
432
433 case 'Language':
434 $par = $this->__getParent();
435 $par->update();
436 $this->__popParent();
437 break;
438
439 case 'Description':
440 $par = $this->__getParent();
441 if ($par instanceof ilMDRights) {
442 $par->parseDescriptionFromImport(
443 $this->__getCharacterData()
444 );
445 } else {
446 $par->setDescription($this->__getCharacterData());
447 }
448 $par->update();
449 if ($par instanceof ilMDDescription) {
450 $this->__popParent();
451 }
452 break;
453
454 case 'Keyword':
455 $par = $this->__getParent();
456 if (!$par instanceof ilMD) {
457 $par->setKeyword($this->__getCharacterData());
458 $this->meta_log->debug("Keyword: " . $this->__getCharacterData());
459 $par->update();
460 $this->__popParent();
461 }
462 break;
463
464 case 'Coverage':
465 $par = $this->__getParent();
466 $par->setCoverage($this->__getCharacterData());
467 break;
468
469 case 'Lifecycle':
470 $par = $this->__getParent();
471 $par->update();
472 $this->__popParent();
473 break;
474
475 case 'Version':
476 $par = $this->__getParent();
477 $par->setVersion($this->__getCharacterData());
478 break;
479
480 case 'Contribute':
481 $par = $this->__getParent();
482 $par->update();
483 $this->__popParent();
484 break;
485
486 case 'Entity':
487 $par = $this->__getParent();
488
489 if (strtolower(get_class($par)) === 'ilmdentity') {
490 $par->setEntity($this->__getCharacterData());
491 $par->update();
492 $this->__popParent();
493 } else {
494 // Single element in 'Annotation'
495 $par->setEntity($this->__getCharacterData());
496 }
497 break;
498
499 case 'Date':
500 $par = $this->__getParent();
501 $par->setDate($this->__getCharacterData());
502 break;
503
504 case 'Meta-Metadata':
505 $par = $this->__getParent();
506 $par->update();
507 $this->__popParent();
508 break;
509
510 case 'Technical':
511 $par = $this->__getParent();
512 $par->update();
513 $this->__popParent();
514 break;
515
516 case 'Format':
517 $par = $this->__getParent();
518 $par->setFormat($this->__getCharacterData());
519 $par->update();
520 $this->__popParent();
521 break;
522
523 case 'Size':
524 $par = $this->__getParent();
525 $par->setSize($this->__getCharacterData());
526 break;
527
528 case 'Location':
529 $par = $this->__getParent();
530 $par->setLocation($this->__getCharacterData());
531 $par->update();
532 $this->__popParent();
533 break;
534
535 case 'Requirement':
536 $par = $this->__getParent();
537 $par->update();
538 $this->__popParent();
539 break;
540
541 case 'OrComposite':
542 $this->__popParent();
543 break;
544
545 case 'Type':
546 break;
547
548 case 'OperatingSystem':
549 break;
550
551 case 'Browser':
552 break;
553
554 case 'InstallationRemarks':
555 $par = $this->__getParent();
556 $par->setInstallationRemarks($this->__getCharacterData());
557 break;
558
559 case 'OtherPlatformRequirements':
560 $par = $this->__getParent();
561 $par->setOtherPlatformRequirements($this->__getCharacterData());
562 break;
563
564 case 'Duration':
565 $par = $this->__getParent();
566 $par->setDuration($this->__getCharacterData());
567 break;
568
569 case 'Educational':
570 $par = $this->__getParent();
571 $par->update();
572 $this->__popParent();
573 break;
574
575 case 'TypicalAgeRange':
576 $par = $this->__getParent();
577 $par->setTypicalAgeRange($this->__getCharacterData());
578 $par->update();
579 $this->__popParent();
580 break;
581
582 case 'TypicalLearningTime':
583 $par = $this->__getParent();
584 $par->setTypicalLearningTime($this->__getCharacterData());
585 break;
586
587 case 'Rights':
588 $par = $this->__getParent();
589 $par->update();
590 $this->__popParent();
591 break;
592
593 case 'Relation':
594 $par = $this->__getParent();
595 $par->update();
596 $this->__popParent();
597 break;
598
599 case 'Resource':
600 break;
601
602 case 'Identifier_':
603 $par = $this->__getParent();
604 $par->update();
605 $this->__popParent();
606 break;
607
608 case 'Annotation':
609 $par = $this->__getParent();
610 $par->update();
611 $this->__popParent();
612 break;
613
614 case 'Classification':
615 $par = $this->__getParent();
616 $par->update();
617 $this->__popParent();
618 break;
619
620 case 'TaxonPath':
621 $par = $this->__getParent();
622 $par->update();
623 $this->__popParent();
624 break;
625
626 case 'Taxon':
627 $par = $this->__getParent();
628 $par->setTaxon($this->__getCharacterData());
629 $par->update();
630 $this->__popParent();
631 break;
632
633 case 'Source':
634 $par = $this->__getParent();
635 $par->setSource($this->__getCharacterData());
636 break;
637
638 }
639 $this->md_chr_data = '';
640 }

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

+ Here is the call graph for this function:

◆ inMetaData()

ilMDSaxParser::inMetaData ( )

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

102 : bool
103 {
104 return $this->md_in_md;
105 }

References $md_in_md.

Referenced by handlerCharacterData().

+ Here is the caller graph for this function:

◆ setHandlers()

ilMDSaxParser::setHandlers (   $a_xml_parser)

Set event handlers.

Parameters
XMLParser|resourcereference to the xml parser

Reimplemented from ilSaxParser.

Reimplemented in ilCourseXMLParser, ilGroupXMLParser, ilQuestionPageParser, ilWebLinkXmlParser, and ilAdvancedMDParser.

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

111 : void
112 {
113 xml_set_object($a_xml_parser, $this);
114 xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
115 xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
116 }

◆ setMDObject()

ilMDSaxParser::setMDObject ( ilMD  $md)

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

92 : void
93 {
94 $this->md = $md;
95 }

References $md.

Referenced by ilMDXMLCopier\__construct(), ilCourseXMLParser\__construct(), ilGroupXMLParser\__construct(), and ilWebLinkXmlParser\__construct().

+ Here is the caller graph for this function:

◆ trimAndStrip()

ilMDSaxParser::trimAndStrip ( string  $input)
protected

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

699 : string
700 {
701 return ilUtil::stripSlashes(trim($input));
702 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ilUtil\stripSlashes().

Referenced by __getCharacterData(), ilCourseXMLParser\handlerEndTag(), ilGroupXMLParser\handlerEndTag(), and trimAndStripAttribs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trimAndStripAttribs()

ilMDSaxParser::trimAndStripAttribs ( array  $attribs)
protected

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

690 : array
691 {
692 $ret = [];
693 foreach ($attribs as $k => $v) {
694 $ret[$k] = $this->trimAndStrip((string) $v);
695 }
696 return $ret;
697 }

References trimAndStrip().

Referenced by ilCourseXMLParser\handlerBeginTag(), ilGroupXMLParser\handlerBeginTag(), and handlerBeginTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $md

ilMD ilMDSaxParser::$md = null
protected

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

Referenced by setMDObject().

◆ $md_ann

ilMDAnnotation ilMDSaxParser::$md_ann = null
protected

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

◆ $md_chr_data

string ilMDSaxParser::$md_chr_data = ''
protected

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

◆ $md_cla

ilMDClassification ilMDSaxParser::$md_cla = null
protected

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

◆ $md_con

ilMDContribute ilMDSaxParser::$md_con = null
protected

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

◆ $md_des

ilMDDescription ilMDSaxParser::$md_des = null
protected

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

◆ $md_edu

ilMDEducational ilMDSaxParser::$md_edu = null
protected

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

◆ $md_ent

ilMDEntity ilMDSaxParser::$md_ent = null
protected

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

◆ $md_for

ilMDFormat ilMDSaxParser::$md_for = null
protected

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

◆ $md_gen

ilMDGeneral ilMDSaxParser::$md_gen = null
protected

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

◆ $md_ide

ilMDIdentifier ilMDSaxParser::$md_ide = null
protected

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

◆ $md_ide_

ilMDIdentifier_ ilMDSaxParser::$md_ide_ = null
protected

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

◆ $md_in_md

bool ilMDSaxParser::$md_in_md = false
protected

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

Referenced by inMetaData().

◆ $md_key

ilMDKeyword ilMDSaxParser::$md_key = null
protected

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

◆ $md_lan

ilMDLanguage ilMDSaxParser::$md_lan = null
protected

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

◆ $md_lif

ilMDLifecycle ilMDSaxParser::$md_lif = null
protected

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

◆ $md_loc

ilMDLocation ilMDSaxParser::$md_loc = null
protected

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

◆ $md_met

ilMDMetaMetadata ilMDSaxParser::$md_met = null
protected

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

◆ $md_orc

ilMDOrComposite ilMDSaxParser::$md_orc = null
protected

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

◆ $md_parent

array ilMDSaxParser::$md_parent = array()
protected

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

◆ $md_parsing_enabled

bool ilMDSaxParser::$md_parsing_enabled
private

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

Referenced by getMDParsingStatus().

◆ $md_rel

ilMDRelation ilMDSaxParser::$md_rel = null
protected

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

◆ $md_req

ilMDRequirement ilMDSaxParser::$md_req = null
protected

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

◆ $md_rig

ilMDRights ilMDSaxParser::$md_rig = null
protected

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

◆ $md_tax

ilMDTaxon ilMDSaxParser::$md_tax = null
protected

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

◆ $md_taxp

ilMDTaxonPath ilMDSaxParser::$md_taxp = null
protected

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

◆ $md_tec

ilMDTechnical ilMDSaxParser::$md_tec = null
protected

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

◆ $md_typ

ilMDTypicalAgeRange ilMDSaxParser::$md_typ = null
protected

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

◆ $meta_log

ilLogger ilMDSaxParser::$meta_log
protected

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


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