ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjQuestionPoolXMLParser Class Reference
+ Inheritance diagram for ilObjQuestionPoolXMLParser:
+ Collaboration diagram for ilObjQuestionPoolXMLParser:

Public Member Functions

 __construct (ilObjQuestionPool $poolOBJ, $xmlFile)
 
 setHandlers ($xmlParser)
 set event handler should be overwritten by inherited class @access private More...
 
 handlerBeginTag ($xmlParser, $tagName, $tagAttributes)
 
 handlerEndTag ($xmlParser, $tagName)
 
 handlerCharacterData ($xmlParser, $charData)
 
- Public Member Functions inherited from ilSaxParser
 ilSaxParser ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object @access public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class @access private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
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. More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
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. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Private Attributes

 $poolOBJ
 
 $inSettingsTag
 
 $inMetaDataTag
 
 $inMdGeneralTag
 

Additional Inherited Members

- 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()
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Definition at line 12 of file class.ilObjQuestionPoolXMLParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjQuestionPoolXMLParser::__construct ( ilObjQuestionPool  $poolOBJ,
  $xmlFile 
)
Parameters
ilObjQuestionPool$poolOBJ
$xmlFile

Definition at line 28 of file class.ilObjQuestionPoolXMLParser.php.

29 {
30 $this->poolOBJ = $poolOBJ;
31
32 $this->inSettingsTag = false;
33 $this->inMetaDataTag = false;
34 $this->inMdGeneralTag = false;
35
36 return parent::ilSaxParser($xmlFile);
37 }

References $poolOBJ.

Member Function Documentation

◆ handlerBeginTag()

ilObjQuestionPoolXMLParser::handlerBeginTag (   $xmlParser,
  $tagName,
  $tagAttributes 
)

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

47 {
48 switch($tagName)
49 {
50 case 'MetaData':
51 $this->inMetaDataTag = true;
52 break;
53
54 case 'General':
55 if($this->inMetaDataTag)
56 {
57 $this->inMdGeneralTag = true;
58 }
59 break;
60
61 case 'Description':
62 if($this->inMetaDataTag && $this->inMdGeneralTag)
63 {
64 $this->cdata = '';
65 }
66 break;
67
68 case 'Settings':
69 $this->inSettingsTag = true;
70 break;
71
72 case 'ShowTaxonomies':
73 case 'NavTaxonomy':
74 case 'SkillService':
75 if($this->inSettingsTag)
76 {
77 $this->cdata = '';
78 }
79 break;
80 }
81 }

◆ handlerCharacterData()

ilObjQuestionPoolXMLParser::handlerCharacterData (   $xmlParser,
  $charData 
)

Definition at line 127 of file class.ilObjQuestionPoolXMLParser.php.

128 {
129 if( $charData != "\n" )
130 {
131 // Replace multiple tabs with one space
132 $charData = preg_replace("/\t+/"," ",$charData);
133
134 $this->cdata .= $charData;
135 }
136 }

◆ handlerEndTag()

ilObjQuestionPoolXMLParser::handlerEndTag (   $xmlParser,
  $tagName 
)

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

84 {
85 switch($tagName)
86 {
87 case 'MetaData':
88 $this->inMetaDataTag = false;
89 break;
90
91 case 'General':
92 if($this->inMetaDataTag)
93 {
94 $this->inMdGeneralTag = false;
95 }
96 break;
97
98 case 'Description':
99 if($this->inMetaDataTag && $this->inMdGeneralTag)
100 {
101 $this->poolOBJ->setDescription($this->cdata);
102 $this->cdata = '';
103 }
104 break;
105
106 case 'Settings':
107 $this->inSettingsTag = false;
108 break;
109
110 case 'ShowTaxonomies':
111 $this->poolOBJ->setShowTaxonomies((bool)$this->cdata);
112 $this->cdata = '';
113 break;
114
115 case 'NavTaxonomy':
116 $this->poolOBJ->setNavTaxonomyId((int)$this->cdata);
117 $this->cdata = '';
118 break;
119
120 case 'SkillService':
121 $this->poolOBJ->setSkillServiceEnabled((bool)$this->cdata);
122 $this->cdata = '';
123 break;
124 }
125 }

◆ setHandlers()

ilObjQuestionPoolXMLParser::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class @access private

Reimplemented from ilSaxParser.

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

40 {
41 xml_set_object($xmlParser,$this);
42 xml_set_element_handler($xmlParser,'handlerBeginTag','handlerEndTag');
43 xml_set_character_data_handler($xmlParser,'handlerCharacterData');
44 }

Field Documentation

◆ $inMdGeneralTag

ilObjQuestionPoolXMLParser::$inMdGeneralTag
private

Definition at line 22 of file class.ilObjQuestionPoolXMLParser.php.

◆ $inMetaDataTag

ilObjQuestionPoolXMLParser::$inMetaDataTag
private

Definition at line 21 of file class.ilObjQuestionPoolXMLParser.php.

◆ $inSettingsTag

ilObjQuestionPoolXMLParser::$inSettingsTag
private

Definition at line 19 of file class.ilObjQuestionPoolXMLParser.php.

◆ $poolOBJ

ilObjQuestionPoolXMLParser::$poolOBJ
private

Definition at line 17 of file class.ilObjQuestionPoolXMLParser.php.

Referenced by __construct().


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