ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSimpleXMLTableDataParser.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 require_once('./Services/Xml/classes/class.ilSaxParser.php');
4 
10 {
11 
15  protected $file = null;
19  protected $xml = null;
23  protected $value = '';
24 
25 
31  public function __construct($a_xml)
32  {
33  $this->file = $a_xml;
34  $this->xml = simplexml_load_file($this->file);
35  }
36 
37 
38  public function startParsing()
39  {
40  global $ilDB;
41 
42  $table = $this->xml->xpath('/Table');
43  foreach ($table[0]->attributes() as $k => $v) {
44  $this->table = $v;
45  }
46 
47  foreach ($this->xml->Row as $row) {
48  $data = array();
49  foreach ($row->children() as $value) {
50  $type = (string) $value['type'];
51  $content = (string) $value;
52  $data[(string) $value['name']] = array(
53  $type,
54  $content,
55  );
56  }
57  $ilDB->insert($this->table, $data);
58  }
59  }
60 }
Add rich text string
$type
__construct($a_xml)
ilSimpleXMLTableDataParser constructor.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
Reload workbook from saved file
Create styles array
The data for the language used.
global $ilDB
if(empty($password)) $table
Definition: pwgen.php:24