コード例 #1
0
ファイル: Xsl.php プロジェクト: rvanvelzen/phpDocumentor2
 /**
  * Sets the parameters of the XSLT processor.
  *
  * @param DocBlox_Transformer_Transformation $transformation Transformation.
  * @param XSLTProcessor                      $proc           XSLTProcessor.
  *
  * @return void
  */
 public function setProcessorParameters(DocBlox_Transformer_Transformation $transformation, XSLTProcessor $proc)
 {
     foreach ($this->xsl_variables as $key => $variable) {
         // XSL does not allow both single and double quotes in a string
         if (strpos($variable, '"') !== false && strpos($variable, "'") !== false) {
             $this->log('XSLT does not allow both double and single quotes in ' . 'a variable; transforming single quotes to a character ' . 'encoded version in variable: ' . $key, Zend_Log::WARN);
             $variable = str_replace("'", "'", $variable);
         }
         $proc->setParameter('', $key, $variable);
     }
     // add / overwrite the parameters with those defined in the
     // transformation entry
     $parameters = $transformation->getParameters();
     if (isset($parameters['variables'])) {
         /** @var DOMElement $variable */
         foreach ($parameters['variables'] as $key => $value) {
             $proc->setParameter('', $key, $value);
         }
     }
 }