Добрый день!
Люди добрые помогите разобраться!!
При выполнении php :
<?php
/** @version $Id: class.xml_xsl.php,v 1.1.1.1 2008/08/20 04:40:26 cvsuser Exp $;
*/
class xml_xsl {
// $isdebug;
function setisdebug($isdebug=0){$this->isdebug=$isdebug;} //
function toxml($db,$sql=null,$filexsl=null,$arr=null ){
if (!empty($this->isdebug)) {
echo '123:$sql:'.$sql; echo "<pre>"; print_r($arr);echo"</pre>";
echo '123:$filexsl:'.$filexsl;
}
$res = $db->query($sql,$arr);
//if (DB::isError($res)) echo "<br>$sql<br>".$res->getMessage();
if (DB::isError($res)) throw new Exception("<br>$sql<br>".$res->getMessage());
if( $row = $res->fetchrow(DB_FETCHMODE_ASSOC)){
if (!empty($this->isdebug)) {
echo '<pre>VAL:';print_r($row['VAL']);echo'</pre>';
}
return self::transform($row['VAL'],$filexsl);
} else {
echo '$sql:'.$sql;
echo '$filexsl:'.$filexsl;
echo '<pre>arr:'; print_r($arr);echo'</pre>';
return self::transform('<TABLE></TABLE>',$filexsl);
}
//echo '$filexsl'.$filexsl;
//}
/*
$xml = new DOMDocument;
$xml->loadXML(iconv("windows-1251", "utf-8", $row['VAL']));
$xsl = new DOMDocument;
//$xsl->load("../template/admin/get.user.info.xsl");
$xsl->load($filexsl);
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl);
return ($this->transform=$proc->transformToXML($xml));
*/
}
function toHTML($db,$sql=null,$filexsl=null,$arr=null ){
if (!empty($this->isdebug)) {
echo '$sql:'.$sql; echo "<pre>"; print_r($arr);echo"</pre>";
echo '$filexsl:'.$filexsl;
}
$res = $db->query($sql,$arr);
//if (DB::isError($res)) echo "<br>$sql<br>".$res->getMessage();
if (DB::isError($res)) throw new Exception("<br>$sql<br>".$res->getMessage());
if( $row = $res->fetchrow(DB_FETCHMODE_ASSOC)){
if (!empty($this->isdebug)) {
echo '<pre>VAL:';print_r($row['VAL']);echo'</pre>';
}
return str_replace('<?xml version="1.0" encoding="Windows-1251"?>','',self::transform($row['VAL'],$filexsl));
} else {
echo '$sql:'.$sql;
echo '$filexsl:'.$filexsl;
echo '<pre>arr:'; print_r($arr);echo'</pre>';
return self::transform('<TABLE></TABLE>',$filexsl);
}
}
function transformToXML($db,$sql=null, $xsl=null,$arr) {
//$this->setisdebug=1;
echo self::toxml($db,$sql, $xsl,$arr);
}
function transformToHTML($db,$sql=null, $xsl=null,$arr) {
//$this->setisdebug=1;
return self::toHTML($db,$sql, $xsl,$arr);
}
public function transform($val='<empty></empty>',$filexsl='',$in_charset='windows-1251',$out_charset='utf-8'){
// if (empty($val)) $val=' ';
$xml = new DOMDocument;
if ($in_charset<>$out_charset)
$xml->loadXML(iconv($in_charset,$out_charset, $val));
else
$xml->loadXML($val);
$xsl = new DOMDocument;
#
$xsl->load($filexsl);
//echo '<pre>';print_r($xsl);echo '</pre>';
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl);
#
return ($this->transform=$proc->transformToXML($xml));
#
}
} //end class
?>
отображаются следующие предупреждения:
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 15 element IMG in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template onclick: failed to compile $p_prep in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 23 element OPTION in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template VALUE: failed to compile $p_id in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 28 element OPTION in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template VALUE: failed to compile $p_id in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 36 element IMG in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template onclick: failed to compile $p_next in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 72 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $cp_tin in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 74 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $cp_ipn in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 133 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $tzn in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 135 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $idd in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 136 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $cvat in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 137 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $cpf in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 138 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $d_end in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 139 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $zvt in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file file:///C%3A/MWEB/HTDOCS/audit/template/vat/table.cp.zb.xsl line 140 element input in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::importStylesheet() [function.importStylesheet]: Attribute template value: failed to compile $id in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 82
Warning: XSLTProcessor::transformToXml() [function.transformToXml]: No stylesheet associated to this object in C:\MWEB\HTDOCS\audit\class\class.xml_xsl.php on line 84
на екране отображаются только эти предупреждения....