[thelist] xslt works on Mac but not on Linux

David Miller david at deadpansincerity.com
Tue Apr 9 02:26:32 CDT 2013


Yay - 40 lines unindented PHP in a mail!

Pastebin [1] is your friend ;-)

OTTOMH the first thing I'd check would be that the XML document you're
trying to check actually exists.

Then I might try:

* posting the whole class to a gist/pastebin
* explaining what problem you're trying to solve here
* hinting at the value of key variables such as the *beautifully* named
$param ;)

[1] http://pastebin.com/w6ccsuDu


On 9 April 2013 00:44, Chris Price <chris.price at choctaw.co.uk> wrote:

> 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)
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



-- 
Love regards etc

David Miller
http://www.deadpansincerity.com
07854 880 883


More information about the thelist mailing list