4 include_once(
"./classes/class.ilSaxParser.php");
32 function __construct($a_top_entity, $a_schema_version, $a_xml, $a_ds, $a_mapping)
35 $this->mapping = $a_mapping;
36 $this->top_entity = $a_top_entity;
37 $this->schema_version = $a_schema_version;
38 $this->dspref = ($this->ds->getDSPrefix() !=
"")
39 ? $this->ds->getDSPrefix().
":"
57 xml_set_object($a_xml_parser,$this);
58 xml_set_element_handler($a_xml_parser,
'handleBeginTag',
'handleEndTag');
59 xml_set_character_data_handler($a_xml_parser,
'handleCharacterData');
78 case $this->dspref.
"Dataset":
82 case $this->dspref.
"Types":
83 $this->current_entity = $a_attribs[
"Entity"];
84 $this->current_version = $a_attribs[
"Version"];
87 case $this->dspref.
"FieldType":
88 $this->current_ftypes[$a_attribs[
"Name"]] =
92 case $this->dspref.
"Rec":
93 $this->current_entity = $a_attribs[
"Entity"];
94 $this->in_record =
true;
95 $this->current_field_values = array();
101 $field = explode(
":", $a_name);
102 $field = $field[count($field) - 1];
103 $this->current_field = $field;
115 case $this->dspref.
"Types":
118 "version" => $this->current_version,
119 "types" => $this->current_ftypes
121 $this->current_ftypes = array();
122 $this->current_entity =
"";
123 $this->current_version =
"";
126 case $this->dspref.
"Rec":
127 $this->ds->importRecord($this->current_entity,
128 $this->entities[$this->current_entity][
"types"],
129 $this->current_field_values,
131 $this->schema_version);
132 $this->in_record =
false;
133 $this->current_entity =
"";
134 $this->current_field_values = array();
138 if ($this->in_record && $this->current_field !=
"")
143 $this->current_field =
"";
147 $this->chr_data =
"";
161 $this->chr_data .= $a_data;