/** * Transform current node and return the result * * Will take advantage of {@link http://pecl.php.net/package/xslcache PECL's xslcache} * if available * * @param string $filepath Path to stylesheet * @param bool $use_xslcache If TRUE, use the XSL Cache extension if available * @return string Result */ public function XSLT($filepath, $use_xslcache = true) { if ($use_xslcache && extension_loaded('xslcache')) { $xslt = new XSLTCache(); $xslt->importStylesheet($filepath); } else { $xsl = new DOMDocument(); $xsl->load($filepath); $xslt = new XSLTProcessor(); $xslt->importStylesheet($xsl); } return $xslt->transformToXML(dom_import_simplexml($this)); }
/** * Transform current node and return the result * * Will take advantage of {@link http://pecl.php.net/package/xslcache PECL's xslcache} * if available * * @param string $filepath Path to stylesheet * @param bool $use_xslcache If TRUE, use the XSL Cache extension if available * * @return string Result * @throws RokCommon_Exception */ public function XSLT($filepath, $use_xslcache = true) { if (!extension_loaded('xsl')) { throw new RokCommon_Exception('XSL PHP extension is not loaded. Unable to use XSLT Function.'); } if ($use_xslcache && extension_loaded('xslcache')) { $xslt = new XSLTCache(); $xslt->importStylesheet($filepath); } else { $xsl = new DOMDocument(); $xsl->load($filepath); $xslt = new XSLTProcessor(); $xslt->importStylesheet($xsl); } return $xslt->transformToXML(dom_import_simplexml($this)); }