10 define (
'BXXSLTRANSFORM_FF', 4);
11 define (
'BXXSLTRANSFORM_FS', 2);
12 define (
'BXXSLTRANSFORM_SF', 1);
13 define (
'BXXSLTRANSFORM_SS', 0);
15 define (
'BXXSLTRANSFORM_XML_FILE', 2);
16 define (
'BXXSLTRANSFORM_XSL_FILE', 1);
24 var
$_header =
'Content-Type: application/xml; charset=UTF-8';
43 if (
'client' ==
$gConf[
'xsl_mode']) {
44 echo
'depricated';
exit;
52 '/_xml' => $this->_xml,
57 if (((
int)phpversion()) >= 5) {
59 $xml =
new DOMDocument();
60 if (!@$xml->loadXML($this->_xml)) {
62 $mk->log (
"ChXslTransform::process - can not load xml:\n " . $this->_xml);
63 $mk->displayError (
"[L[Site is unavailable]]");
66 $xsl =
new DomDocument();
67 $xsl->load($this->_xsl);
69 $proc =
new XsltProcessor();
70 $proc->importStyleSheet($xsl);
71 $res = $proc->transformToXML($xml);
75 if (function_exists(
'domxml_xslt_stylesheet_file')) {
76 $xmldoc =
new DomDocument ($this->_xml);
77 $xsldoc = domxml_xslt_stylesheet_file($this->_xsl);
78 $result = $xsldoc->process($xmldoc);
79 $res = $xsldoc->result_dump_mem($result);
80 } elseif (function_exists (
'xslt_create')) {
82 xslt_setopt($xh, XSLT_SABOPT_IGNORE_DOC_NOT_FOUND);
83 $res = xslt_process ($xh,
'arg:/_xml', $this->_xsl, NULL, $args);
86 die(
'Server XSLT support is not enabled, try to use client XSL transformation http://your-domain/orca_folder/?xsl_mode=client');
96 if (((
int)phpversion()) >= 5) {
97 $xml =
new DOMDocument();
98 $xml->load($this->_xml);
100 $xsl =
new DomDocument();
101 $xsl->load($this->_xsl);
103 $proc =
new XsltProcessor();
104 $proc->importStyleSheet($xsl);
105 $res = $proc->transformToXML($xml);
107 if (function_exists(
'domxml_xslt_stylesheet_file')) {
108 $xmldoc =
new DomDocument ($this->_xml);
109 $xsldoc = domxml_xslt_stylesheet_file($this->_xsl);
110 $result = $xsldoc->process($xmldoc);
111 $res = $xsldoc->result_dump_mem($result);
112 } elseif (function_exists (
'xslt_create')) {
114 $res = xslt_process ($xh, $this->_xml, $this->_xsl, NULL, $args);
115 xslt_setopt($xh, XSLT_SABOPT_IGNORE_DOC_NOT_FOUND);
118 die(
'XSLT support is not enabled');
125 return "<h1>not supported</h1>";
137 list ($usec, $sec) = explode (
' ', microtime());
138 srand ((
float) $sec + ((
float) $usec * 100000));
139 return $this->_tmp_dir .
'/' . rand() .
'_' . rand() .
'.xml';