$_GET['page'], 'article' => $_GET['article'], 'language' => $_GET['language'] ); $page = $_GET['page']; $article = $_GET['article']; $language = $_GET['language']; $cached_name = "cache/$xslfilename$page$article$language.xml"; // does a cached version exist? if (file_exists($cached_name)) { readfile($cached_name); } else { // load the xml file and stylesheet as domdocuments $xsl = new DomDocument(); $xsl->load("xsl/$xslfilename.xsl"); $xml = new DomDocument(); $xml->load("xml/index.xml"); $xml->Xinclude(); // create the processor and import the stylesheet $proc = new XsltProcessor(); $xsl = $proc->importStylesheet($xsl); $proc->setParameter(null, $arguments); // transform and output the xml document, caching result $output = $proc->transformToDoc($xml)->saveXML(); // enable this line on server to enable caching file_put_contents($cached_name, $output); print $output; } ?>