ASP to PHP migration : PicasaWeb feed XSLT
I’ve been transferring most of my hosting away from 1&1 [previous blog article] and as part of that I am also moving from ASP hosting services to PHP. I have been using XSLT to transform a feed from PicasaWeb to create a simple interface to browse our family photos, and so needed to convert these ASP pages to PHP (the XSL will initially remain the same, though I should also really update the design)
The minor changes needed were as follows:
Querystring params: $_GET[‘field’] instead of request.querystring(‘field’)
Concatenating Strings: use ‘.’ instead of ‘+’
(PHP String Operators: http://php.net/manual/en/language.operators.string.php )
XLST Transformation code now [PHP]:
$xslDoc = new DOMDocument();
$xslDoc->load(“file.xsl”);
$xmlDoc = new DOMDocument();
$xmlDoc->load(“source.xml”);
$proc = new XSLTProcessor();
$proc->importStylesheet($xslDoc);
echo $proc->transformToXML($xmlDoc);
XLST Transformation code WAS [ASP]:
var mm_xsl = new MM_XSLTransform();
mm_xsl.setXML(source.xml”);
mm_xsl.setXSL(“file.xsl”);
Response.write (mm_xsl.Transform());
The temporary home of the migrated page is: http://allbs.co.uk/picasa/picasa.php