Esempio n. 1
0
 /**
  * The constructor for the `XSLTPage` ensures that an `XSLTProcessor`
  * is available, and then sets an instance of it to `$this->Proc`, otherwise
  * it will throw a `SymphonyErrorPage` exception.
  */
 public function __construct()
 {
     if (!XsltProcess::isXSLTProcessorAvailable()) {
         Symphony::Engine()->throwCustomError(__('No suitable XSLT processor was found.'));
     }
     $this->Proc = new XsltProcess();
 }
Esempio n. 2
0
 function __construct()
 {
     if (!XsltProcess::isXSLTProcessorAvailable()) {
         trigger_error(__('No suitable XSLT processor was found.'), E_USER_ERROR);
     }
     $this->Proc =& new XsltProcess();
 }
Esempio n. 3
0
 public function __construct()
 {
     if (!XsltProcess::isXSLTProcessorAvailable()) {
         throw new SymphonyErrorPage(__('No suitable XSLT processor was found.'));
     }
     $this->Proc = new XsltProcess();
     $this->_registered_php_functions = array();
 }
Esempio n. 4
0
 /**
  * The constructor for the `XSLTPage` ensures that an `XSLTProcessor`
  * is available, and then sets an instance of it to `$this->Proc`, otherwise
  * it will throw a `SymphonyErrorPage` exception.
  */
 public function __construct()
 {
     if (!XsltProcess::isXSLTProcessorAvailable()) {
         GenericExceptionHandler::$enabled = true;
         throw new SymphonyErrorPage(__('No suitable XSLT processor was found.'));
     }
     $this->Proc = new XsltProcess();
 }
 /**
  * This function will take a given XML file, a stylesheet and apply
  * the transformation. Any errors will call the error function to log
  * them into the `$_errors` array
  *
  * @see toolkit.XSLTProcess#__error()
  * @see toolkit.XSLTProcess#__process()
  * @param string $xml
  *  The XML for the transformation to be applied to
  * @param string $xsl
  *  The XSL for the transformation
  * @param array $parameters
  *  An array of available parameters the XSL will have access to
  * @param array $register_functions
  *  An array of available PHP functions that the XSL can use
  * @return string|boolean
  *  The string of the resulting transform, or false if there was an error
  */
 public function process($xml = null, $xsl = null, array $parameters = array(), array $register_functions = array())
 {
     if ($xml) {
         $this->_xml = $xml;
     }
     if ($xsl) {
         $this->_xsl = $xsl;
     }
     // dont let process continue if no xsl functionality exists
     if (!XsltProcess::isXSLTProcessorAvailable()) {
         return false;
     }
     $XSLProc = new XsltProcessor();
     if (!empty($register_functions)) {
         $XSLProc->registerPHPFunctions($register_functions);
     }
     $result = @$this->__process($XSLProc, $this->_xml, $this->_xsl, $parameters);
     unset($XSLProc);
     return $result;
 }