ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilXML2FO.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
34
class
ilXML2FO
35
{
36
public
$xslt
=
null
;
37
public
$xml
=
null
;
38
public
$fo_string
=
null
;
39
40
public
$xslt_handler
=
null
;
41
public
$xslt_args
=
null
;
42
public
$xslt_params
=
null
;
43
44
public
function
setXMLString
($a_xml)
45
{
46
$this->xml = $a_xml;
47
}
48
public
function
getXMLString
()
49
{
50
return
$this->xml
;
51
}
52
public
function
setXSLTLocation
($xslt_location)
53
{
54
$this->xslt = $xslt_location;
55
}
56
public
function
getXSLTLocation
()
57
{
58
return
$this->xslt
;
59
}
60
public
function
getFOString
()
61
{
62
return
$this->fo_string
;
63
}
64
public
function
setXSLTParams
(
$params
)
65
{
66
$this->xslt_params =
$params
;
67
}
68
public
function
getXSLTParams
()
69
{
70
return
$this->xslt_params
;
71
}
72
public
function
transform
()
73
{
74
global
$ilLog
;
75
76
$this->
__init
();
77
78
$this->fo_string = @xslt_process(
79
$this->xslt_handler,
80
"arg:/_xml"
,
81
"arg:/_xsl"
,
82
null
,
83
$this->xslt_args,
84
$this->xslt_params
85
);
86
87
88
if
(strlen($error_msg =
xslt_error
($this->xslt_handler))) {
89
$ilLog
->write(
"Error generating pdf: "
. $error_msg);
90
return
false
;
91
}
92
93
xslt_free
($this->xslt_handler);
94
95
return
true
;
96
}
97
98
// Private
99
public
function
__init
()
100
{
101
102
#domxml_open_mem($this->getXMLString(), DOMXML_LOAD_VALIDATING, $error);
103
#if($error)
104
#{
105
# var_dump("<pre>"
,"XML ERROR: ".$error,htmlentities($this->getXMLString()),"<pre>");
106
#}
107
108
$this->xslt_handler =
xslt_create
();
109
$this->xslt_args = array(
'/_xml'
=> $this->
getXMLString
(),
110
'/_xsl'
=> file_get_contents($this->
getXSLTLocation
()));
111
112
return
true
;
113
}
114
}
php
An exception for terminatinating execution or to throw for unit testing.
ilXML2FO
Definition:
class.ilXML2FO.php:35
ilXML2FO\getXMLString
getXMLString()
Definition:
class.ilXML2FO.php:48
ilXML2FO\setXMLString
setXMLString($a_xml)
Definition:
class.ilXML2FO.php:44
ilXML2FO\$xslt_params
$xslt_params
Definition:
class.ilXML2FO.php:42
ilXML2FO\getXSLTParams
getXSLTParams()
Definition:
class.ilXML2FO.php:68
ilXML2FO\getXSLTLocation
getXSLTLocation()
Definition:
class.ilXML2FO.php:56
ilXML2FO\$xslt_args
$xslt_args
Definition:
class.ilXML2FO.php:41
ilXML2FO\setXSLTLocation
setXSLTLocation($xslt_location)
Definition:
class.ilXML2FO.php:52
ilXML2FO\$xml
$xml
Definition:
class.ilXML2FO.php:37
ilXML2FO\__init
__init()
Definition:
class.ilXML2FO.php:99
ilXML2FO\transform
transform()
Definition:
class.ilXML2FO.php:72
ilXML2FO\$fo_string
$fo_string
Definition:
class.ilXML2FO.php:38
ilXML2FO\$xslt_handler
$xslt_handler
Definition:
class.ilXML2FO.php:40
ilXML2FO\setXSLTParams
setXSLTParams($params)
Definition:
class.ilXML2FO.php:64
ilXML2FO\getFOString
getFOString()
Definition:
class.ilXML2FO.php:60
ilXML2FO\$xslt
$xslt
Definition:
class.ilXML2FO.php:36
$ilLog
$ilLog
Definition:
inc.setup_header.php:123
xslt_error
xslt_error(&$proc)
Definition:
inc.xsl5compliance.php:86
xslt_free
xslt_free(&$proc)
Definition:
inc.xsl5compliance.php:80
xslt_create
xslt_create()
Definition:
inc.xsl5compliance.php:24
PHPMailer\PHPMailer\$params
$params
Definition:
get_oauth_token.php:84
Services
Transformation
classes
class.ilXML2FO.php
Generated on Thu Oct 2 2025 19:02:00 for ILIAS by
1.9.4 (using
Doxyfile
)