ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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
require_once(
'./Services/Xml/classes/class.ilSaxParser.php'
);
4
9
class
ilSimpleXMLTableDataParser
extends
ilSaxParser
10
{
11
15
protected
$table
;
19
protected
$file
= null;
23
protected
$xml
= null;
27
protected
$value
=
''
;
28
29
35
public
function
__construct
($a_xml)
36
{
37
$this->file = $a_xml;
38
$this->xml = simplexml_load_file($this->file);
39
}
40
41
42
public
function
startParsing
()
43
{
44
global
$DIC
;
45
$ilDB
= $DIC->database();
46
47
$table
= $this->xml->xpath(
'/Table'
);
48
foreach
(
$table
[0]->attributes() as $k => $v) {
49
$this->table = $v;
50
}
51
52
foreach
($this->xml->Row as
$row
) {
53
$data
= array();
54
foreach
($row->children() as
$value
) {
55
$type
= (string)
$value
[
'type'
];
56
$content = (string)
$value
;
57
$data
[(string)
$value
[
'name'
]] = array(
58
$type
,
59
$content,
60
);
61
}
62
$ilDB
->insert($this->table,
$data
);
63
}
64
}
65
}
ilSimpleXMLTableDataParser
Definition:
class.ilSimpleXMLTableDataParser.php:9
$type
$type
Definition:
proxy_ylocal.php:10
$DIC
global $DIC
Definition:
saml.php:7
ilSimpleXMLTableDataParser\__construct
__construct($a_xml)
ilSimpleXMLTableDataParser constructor.
Definition:
class.ilSimpleXMLTableDataParser.php:35
ilSimpleXMLTableDataParser\$xml
$xml
Definition:
class.ilSimpleXMLTableDataParser.php:23
ilSaxParser
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
Definition:
class.ilSaxParser.php:17
ilSimpleXMLTableDataParser\$table
$table
Definition:
class.ilSimpleXMLTableDataParser.php:15
ilSimpleXMLTableDataParser\$value
$value
Definition:
class.ilSimpleXMLTableDataParser.php:27
$row
$row
Definition:
migrateto20.php:360
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilSimpleXMLTableDataParser\$file
$file
Definition:
class.ilSimpleXMLTableDataParser.php:19
php
ilSimpleXMLTableDataParser\startParsing
startParsing()
Definition:
class.ilSimpleXMLTableDataParser.php:42
$data
$data
Definition:
bench.php:6
Services
Database
classes
class.ilSimpleXMLTableDataParser.php
Generated on Thu Jan 30 2025 19:01:57 for ILIAS by
1.8.13 (using
Doxyfile
)