Public Member Functions | |
ilSaxParser ($a_xml_file= '') | |
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 | |
setHandlers ($a_xml_parser) | |
set event handler should be overwritten by inherited class private | |
openXMLFile () | |
open xml file | |
parse ($a_xml_parser, $a_fp=null) | |
parse xml file | |
freeParser ($a_xml_parser) | |
free xml parser handle | |
Data Fields | |
$input_type = null | |
$xml_content = '' | |
$ilias | |
$lng | |
$xml_file |
Definition at line 36 of file class.ilSaxParser.php.
ilSaxParser::createParser | ( | ) |
create parser
private
Definition at line 145 of file class.ilSaxParser.php.
Referenced by ilnetucateResponse::startParsing(), and startParsing().
{ $xml_parser = xml_parser_create("UTF-8"); if($xml_parser == false) { $this->ilias->raiseError("Cannot create an XML parser handle",$this->ilias->error_obj->FATAL); } return $xml_parser; }
ilSaxParser::freeParser | ( | $ | a_xml_parser | ) |
free xml parser handle
private
Definition at line 220 of file class.ilSaxParser.php.
Referenced by ilnetucateResponse::startParsing(), and startParsing().
{ if(!xml_parser_free($a_xml_parser)) { $this->ilias->raiseError("Error freeing xml parser handle ",$this->ilias->error_obj->FATAL); } }
ilSaxParser::getInputType | ( | ) |
Definition at line 106 of file class.ilSaxParser.php.
Referenced by parse(), and startParsing().
{
return $this->input_type;
}
ilSaxParser::getXMLContent | ( | ) |
Definition at line 101 of file class.ilSaxParser.php.
Referenced by parse().
{
return $this->xml_content;
}
ilSaxParser::ilSaxParser | ( | $ | a_xml_file = '' |
) |
Constructor setup ILIAS global object public.
Definition at line 81 of file class.ilSaxParser.php.
Referenced by ilCategoryImportParser::ilCategoryImportParser(), ilForumImportParser::ilForumImportParser(), ilGroupImportParser::ilGroupImportParser(), ilMailImportParser::ilMailImportParser(), ilMDSaxParser::ilMDSaxParser(), ilModuleReader::ilModuleReader(), ilnetucateResponse::ilnetucateResponse(), ilObjectDefinition::ilObjectDefinition(), ilObjectXMLParser::ilObjectXMLParser(), ilQTIParser::ilQTIParser(), ilSCORMPackageParser::ilSCORMPackageParser(), ilServiceReader::ilServiceReader(), ilStyleDefinition::ilStyleDefinition(), ilStyleImportParser::ilStyleImportParser(), ilUserImportParser::ilUserImportParser(), and ilXMLResultSetParser::ilXMLResultSetParser().
{ global $ilias, $lng; if($a_xml_file) { $this->xml_file = $a_xml_file; $this->input_type = 'file'; } $this->ilias = &$ilias; $this->lng = &$lng; }
ilSaxParser::openXMLFile | ( | ) |
open xml file
private
Definition at line 178 of file class.ilSaxParser.php.
Referenced by startParsing().
{ if(!($fp = fopen($this->xml_file,'r'))) { $this->ilias->raiseError("Cannot open xml file",$this->ilias->error_obj->FATAL); } return $fp; }
ilSaxParser::parse | ( | $ | a_xml_parser, | |
$ | a_fp = null | |||
) |
parse xml file
private
Reimplemented in ilnetucateResponse.
Definition at line 191 of file class.ilSaxParser.php.
References $data, getInputType(), and getXMLContent().
Referenced by startParsing().
{ switch($this->getInputType()) { case 'file': while($data = fread($a_fp,4096)) { $parseOk = xml_parse($a_xml_parser,$data,feof($a_fp)); } break; case 'string': $parseOk = xml_parse($a_xml_parser,$this->getXMLContent()); break; } if(!$parseOk && (xml_get_error_code($a_xml_parser) != XML_ERROR_NONE)) { $this->ilias->raiseError("XML Parse Error: ".xml_get_error_code($a_xml_parser),$this->ilias->error_obj->FATAL); } return true; }
ilSaxParser::setHandlers | ( | $ | a_xml_parser | ) |
set event handler should be overwritten by inherited class private
Reimplemented in ilQTIParser, ilCategoryImportParser, ilForumImportParser, ilGroupImportParser, ilMailImportParser, ilObjectDefinition, ilStyleDefinition, ilStyleImportParser, ilUserImportParser, ilContObjParser, ilSCORMPackageParser, ilCourseXMLParser, ilnetucateResponse, ilMDSaxParser, ilMDXMLCopier, ilMDXMLParser, ilModuleReader, ilServiceReader, ilObjectXMLParser, and ilXMLResultSetParser.
Definition at line 169 of file class.ilSaxParser.php.
Referenced by startParsing().
{
echo 'ilSaxParser::setHandlers() must be overwritten';
}
ilSaxParser::setOptions | ( | $ | a_xml_parser | ) |
set parser options
private
Definition at line 160 of file class.ilSaxParser.php.
Referenced by ilnetucateResponse::startParsing(), and startParsing().
{
xml_parser_set_option($a_xml_parser,XML_OPTION_CASE_FOLDING,false);
}
ilSaxParser::setXMLContent | ( | $ | a_xml_content | ) |
Definition at line 95 of file class.ilSaxParser.php.
Referenced by ilGroupImportParser::ilGroupImportParser(), ilMDXMLCopier::ilMDXMLCopier(), ilMDXMLParser::ilMDXMLParser(), ilObjectXMLParser::ilObjectXMLParser(), and ilXMLResultSetParser::ilXMLResultSetParser().
{
$this->xml_content = $a_xml_content;
$this->input_type = 'string';
}
ilSaxParser::startParsing | ( | ) |
stores xml data in array
private
Reimplemented in ilQTIParser, ilCategoryImportParser, ilForumImportParser, ilGroupImportParser, ilMailImportParser, ilStyleImportParser, ilUserImportParser, ilContObjParser, ilSCORMPackageParser, and ilnetucateResponse.
Definition at line 116 of file class.ilSaxParser.php.
References createParser(), freeParser(), getInputType(), openXMLFile(), parse(), setHandlers(), and setOptions().
Referenced by ilModuleReader::getModules(), and ilServiceReader::getServices().
{ $xml_parser = $this->createParser(); $this->setOptions($xml_parser); $this->setHandlers($xml_parser); switch($this->getInputType()) { case 'file': $fp = $this->openXMLFile(); $this->parse($xml_parser,$fp); break; case 'string': $this->parse($xml_parser); break; default: $this->ilias->raiseError("No input type given. Set filename in constructor or choose setXMLContent()", $this->ilias->error_obj->FATAL); break; } $this->freeParser($xml_parser); }
ilSaxParser::$ilias |
Definition at line 60 of file class.ilSaxParser.php.
Referenced by ilGroupImportParser::__assignMembers(), ilCourseXMLParser::__parseId(), ilGroupImportParser::__parseId(), ilStyleDefinition::getAllTemplates(), ilCategoryImportParser::handlerEndTag(), ilSaxParser(), ilStyleDefinition::ilStyleDefinition(), ilUserImportParser::ilUserImportParser(), ilUserImportParser::importBeginTag(), and ilUserImportParser::importEndTag().
ilSaxParser::$input_type = null |
Definition at line 45 of file class.ilSaxParser.php.
ilSaxParser::$lng |
Reimplemented in ilQTIParser, ilContObjParser, and ilCourseXMLParser.
Definition at line 67 of file class.ilSaxParser.php.
Referenced by ilUserImportParser::getProtocolAsHTML(), ilMDSaxParser::ilMDSaxParser(), ilSaxParser(), ilStyleImportParser::ilStyleImportParser(), ilUserImportParser::ilUserImportParser(), ilUserImportParser::importBeginTag(), ilUserImportParser::importEndTag(), ilUserImportParser::verifyBeginTag(), and ilUserImportParser::verifyEndTag().
ilSaxParser::$xml_content = '' |
Definition at line 53 of file class.ilSaxParser.php.
ilSaxParser::$xml_file |
Definition at line 74 of file class.ilSaxParser.php.