[thelist] xslt works on Mac but not on Linux
Chris Price
chris.price at choctaw.co.uk
Mon Apr 8 18:44:26 CDT 2013
This has completely baffled me.
I have one xml file and two xsl files (form.xls and mail.xls) and a class
for extracting data
I have a function for extracting xml via xslt:
public function xmlTransform($xsl,$xml,$postArray) {
$style = new DOMDocument;
$style->load('data/'.$xsl.'.xsl');
$source = new DOMDocument;
$source->load('data/'.$xml.'.xml');
$proc = new XSLTProcessor();
$proc->registerPHPFunctions();
$proc->importStylesheet($style);
$transformData = array($proc,$source);
foreach ($postArray as $key => $value) {
$transformData[0]->setParameter('',$key,$value);
}
return $transformData[0]->transformToXML($transformData[1]);
}
I can extract an html form using this getForm function which calls
xmlTransform function:
public function getForm($param) {
$paramArray = explode(' ',$param);
if ($_POST['runon'] == 'end') {
if (self::checkValid()) return
"<p><strong>".self::sendMail()."</strong></p>\r";
else return self::getXMLData('xmlData')->emailFail;
}
else {
if (!$form = $_POST['runon']) $form = $paramArray[0];
$code = self::keyCode();
$postArray = array();
if ($_POST) $postArray = $_POST['mail'];
$postArray['destination'] = $paramArray[1].".php";
$postArray['cipher'] = $code[0];
$postArray['code'] = $code[1];
$postArray['timestamp'] = time();
}
return self::xmlTransform('form',$form,$postArray);
}
However, when I try to extract via mail.xsl using: $text =
self::xmlTransform('mail',$form,$postArray);
it works on my Mac but on the Linux server $text is null.
When I've corrupted mail.xsl it gives me an error on the Mac but not on the
server.
I have absolutely no idea what's going on.
--
Kind Regards
Chris.Price
@Choctaw.co.uk <http://%5C%5Cchoctaw.co.uk/>
0777 629 0227
Design is my native language
Choctaw Media Ltd is a company registered in England and Wales (04627649)
More information about the thelist
mailing list