4 include_once(
"./Services/Xml/classes/class.ilSaxParser.php");
33 public function __construct($a_top_entity, $a_schema_version, $a_xml, $a_ds, $a_mapping)
36 $this->mapping = $a_mapping;
37 $this->top_entity = $a_top_entity;
38 $this->schema_version = $a_schema_version;
39 $this->dspref = ($this->ds->getDSPrefix() !=
"")
40 ? $this->ds->getDSPrefix() .
":" 43 parent::__construct();
68 xml_set_object($a_xml_parser, $this);
69 xml_set_element_handler($a_xml_parser,
'handleBeginTag',
'handleEndTag');
70 xml_set_character_data_handler($a_xml_parser,
'handleCharacterData');
79 parent::startParsing();
88 case $this->dspref .
"DataSet":
90 $this->current_installation_id = $a_attribs[
"InstallationId"];
91 $this->ds->setCurrentInstallationId($a_attribs[
"InstallationId"]);
94 case $this->dspref .
"Types":
95 $this->current_entity = $a_attribs[
"Entity"];
96 $this->current_version = $a_attribs[
"Version"];
99 case $this->dspref .
"FieldType":
100 $this->current_ftypes[$a_attribs[
"Name"]] =
104 case $this->dspref .
"Rec":
105 $this->current_entity = $a_attribs[
"Entity"];
106 $this->in_record =
true;
107 $this->current_field_values =
array();
111 if ($this->in_record) {
112 $field = explode(
":", $a_name);
113 $field = $field[count($field) - 1];
114 $this->current_field = $field;
125 case $this->dspref .
"Types":
128 "version" => $this->current_version,
129 "types" => $this->current_ftypes
131 $this->current_ftypes =
array();
132 $this->current_entity =
"";
133 $this->current_version =
"";
136 case $this->dspref .
"Rec":
137 $this->ds->importRecord(
138 $this->current_entity,
139 $this->entities[$this->current_entity][
"types"],
140 $this->current_field_values,
142 $this->schema_version
144 $this->in_record =
false;
145 $this->current_entity =
"";
146 $this->current_field_values =
array();
150 if ($this->in_record && $this->current_field !=
"") {
154 $this->current_field =
"";
158 $this->chr_data =
"";
172 $this->chr_data .= $a_data;
handleBeginTag($a_xml_parser, $a_name, $a_attribs)
Begin Tag.
startParsing()
Start parser.
Manifest parser for ILIAS standard export files.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
getCurrentInstallationId()
Get current installation id.
__construct($a_top_entity, $a_schema_version, $a_xml, $a_ds, $a_mapping)
Constructor.
Create styles array
The data for the language used.
handleCharacterData($a_xml_parser, $a_data)
End Tag.
handleEndTag($a_xml_parser, $a_name)
End Tag.
setHandlers($a_xml_parser)
Set event handlers.
setXMLContent($a_xml_content)