ILIAS
Release_4_4_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilXMLResultSetWriter.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once
"./Services/Xml/classes/class.ilXmlWriter.php"
;
6
13
class
ilXMLResultSetWriter
extends
ilXmlWriter
14
{
15
var
$xmlResultSet
;
16
17
function
ilXMLResultSetWriter
(&
$xmlResultSet
)
18
{
19
parent::ilXmlWriter
();
20
$this->xmlResultSet =
$xmlResultSet
;
21
}
22
23
24
function
start
()
25
{
26
if
(!is_object($this->xmlResultSet))
27
{
28
return
false
;
29
}
30
31
$this->
__buildHeader
();
32
33
$this->
__buildColSpecs
();
34
35
$this->
__buildRows
();
36
37
$this->
__buildFooter
();
38
39
return
true
;
40
}
41
42
function
getXML
()
43
{
44
return
$this->
xmlDumpMem
(FALSE);
45
}
46
47
48
// PRIVATE
49
function
__appendRow
(& $xmlResultSetRow)
50
{
51
$this->
xmlStartTag
(
'row'
,null);
52
53
foreach
($xmlResultSetRow->getColumns() as $value)
54
{
55
$this->
xmlElement
(
'column'
,null,$value);
56
57
}
58
59
$this->
xmlEndTag
(
'row'
);
60
61
}
62
63
64
function
__buildHeader
()
65
{
66
$this->
xmlSetDtdDef
(
"<!DOCTYPE result PUBLIC \"-//ILIAS//DTD XMLResultSet//EN\" \""
.ILIAS_HTTP_PATH.
"/xml/ilias_xml_resultset_3_7.dtd\">"
);
67
$this->
xmlHeader
();
68
69
$this->
xmlStartTag
(
"result"
);
70
71
return
true
;
72
}
73
74
function
__buildColSpecs
() {
75
$this->
xmlStartTag
(
"colspecs"
);
76
77
foreach
($this->xmlResultSet->getColSpecs() as $colSpec) {
78
$attr = array (
"idx"
=> $colSpec->getIndex(),
"name"
=> $colSpec->getName());
79
80
$this->
xmlElement
(
"colspec"
, $attr, null);
81
}
82
83
$this->
xmlEndTag
(
"colspecs"
);
84
}
85
86
function
__buildRows
() {
87
$this->
xmlStartTag
(
"rows"
);
88
89
foreach
($this->xmlResultSet->getRows() as
$row
)
90
{
91
$this->
__appendRow
(
$row
);
92
}
93
94
$this->
xmlEndTag
(
"rows"
);
95
}
96
97
function
__buildFooter
()
98
{
99
$this->
xmlEndTag
(
'result'
);
100
}
101
102
103
104
}
105
106
107
?>
webservice
soap
classes
class.ilXMLResultSetWriter.php
Generated on Wed Apr 27 2016 20:02:08 for ILIAS by
1.8.1.2 (using
Doxyfile
)