Quote:
Originally Posted by sachinshastri
according to u first i will convert my xml into xsl
I never said that. I said, you’d need an XSL file to do the conversion.
here is a part of my project, using xml conversion.
on line 17 I pass an xml file (name), read from the input object
$inSeite_in, via a selfmade wrapper to PHP’s XSLTprocessor class.
on line 18 I do the same with the xsl file name
line 20 triggers the conversion and returns the result xml (in this case xhtml)
- protected function Transform(
-
Seite $inSEITE_in,
-
$sy_par = '',
-
$f_empty = XSLT_FORCE_RESULT
-
)
-
{
-
# set parameter correctly
-
$param = ($sy_par === '' and isset($this->ID)) ? $this->ID : $sy_par;
-
$mp_param = ($inSEITE_in->PAR_NAME) ? $inSEITE_in->getValue('PAR_ARRAY', $param) : array();
-
-
try
-
{ # load XSLT
-
$inXSLT_process = XSLTransform::getInstance();
-
# set parameter
-
$inXSLT_process->emptyResult = (bool) $f_empty;
-
# load files
-
$inXSLT_process->loadXML($inSEITE_in->XML);
-
$inXSLT_process->loadXSL($inSEITE_in->XSL);
-
# processing
-
$data = $inXSLT_process->Process($mp_param);
-
}
-
catch (ProcException $pe)
-
{
-
ErrorLog::add($pe, __CLASS__);
-
trigger_error(500, E_USER_ERROR);
-
return '<!-- Parser Error -->'; // ???
-
}
-
return $data;
-
}
-