ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
◀ ilDoc Overview
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
8
class
ilSimpleXMLTableDataParser
extends
ilSaxParser
9
{
10
protected
$file
= null;
11
protected
$xml
= null;
12
13
protected
$value
=
''
;
14
15
public
function
__construct
($a_xml)
16
{
17
$this->file = $a_xml;
18
19
$this->xml = simplexml_load_file($this->file);
20
}
21
22
public
function
startParsing
()
23
{
24
global
$ilDB
;
25
26
$table = $this->xml->xpath(
'/Table'
);
27
foreach
($table[0]->attributes() as $k => $v)
28
{
29
$this->table = $v;
30
}
31
32
foreach
($this->xml->Row as
$row
)
33
{
34
$data
= array();
35
foreach
($row->children() as
$value
)
36
{
37
$type = (string)
$value
[
'type'
];
38
$content = (string)
$value
;
39
$data
[(string)
$value
[
'name'
]] = array(
40
$type,$content);
41
42
}
43
$ilDB->insert($this->table,
$data
);
44
}
45
46
}
47
48
}
49
?>
ilSimpleXMLTableDataParser
Definition:
class.ilSimpleXMLTableDataParser.php:8
ilSimpleXMLTableDataParser\__construct
__construct($a_xml)
Definition:
class.ilSimpleXMLTableDataParser.php:15
ilSimpleXMLTableDataParser\$xml
$xml
Definition:
class.ilSimpleXMLTableDataParser.php:11
ilSaxParser
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
Definition:
class.ilSaxParser.php:17
$data
$data
Definition:
storeScorm2004.php:37
$row
$row
Definition:
examplelayouts.sql.php:26
ilSimpleXMLTableDataParser\$value
$value
Definition:
class.ilSimpleXMLTableDataParser.php:13
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilSimpleXMLTableDataParser\$file
$file
Definition:
class.ilSimpleXMLTableDataParser.php:10
ilSimpleXMLTableDataParser\startParsing
startParsing()
Definition:
class.ilSimpleXMLTableDataParser.php:22
Services
Database
classes
class.ilSimpleXMLTableDataParser.php
Generated on Mon Sep 1 2025 19:00:44 for ILIAS by
1.8.13 (using
Doxyfile
)