當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XSLTProcessor::removeParameter方法代碼示例

本文整理匯總了PHP中XSLTProcessor::removeParameter方法的典型用法代碼示例。如果您正苦於以下問題:PHP XSLTProcessor::removeParameter方法的具體用法?PHP XSLTProcessor::removeParameter怎麽用?PHP XSLTProcessor::removeParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XSLTProcessor的用法示例。


在下文中一共展示了XSLTProcessor::removeParameter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: convert

 /**
  * Convert documents between two formats
  *
  * Convert documents of the given type to the requested type.
  *
  * @param ezcDocumentXmlBase $doc
  * @return ezcDocumentXmlBase
  */
 public function convert($doc)
 {
     // Create XSLT processor, if not yet initialized
     if ($this->xsltProcessor === null) {
         $stylesheet = new DOMDocument();
         $stylesheet->load($this->options->xslt);
         $this->xsltProcessor = new XSLTProcessor();
         $this->xsltProcessor->importStyleSheet($stylesheet);
     }
     // Set provided parameters.
     foreach ($this->options->parameters as $namespace => $parameters) {
         foreach ($parameters as $option => $value) {
             $this->xsltProcessor->setParameter($namespace, $option, $value);
         }
     }
     // We want to handle the occured errors ourselves.
     $oldErrorHandling = libxml_use_internal_errors(true);
     // Transform input document
     $dom = $this->xsltProcessor->transformToDoc($doc->getDomDocument());
     $errors = $this->options->failOnError ? libxml_get_errors() : null;
     libxml_clear_errors();
     libxml_use_internal_errors($oldErrorHandling);
     // If there are errors and the error handling is activated throw an
     // exception with the occured errors.
     if ($errors) {
         throw new ezcDocumentErroneousXmlException($errors);
     }
     // Reset parameters, so they are not automatically applied to the next
     // traansformation.
     foreach ($this->options->parameters as $namespace => $parameters) {
         foreach ($parameters as $option => $value) {
             $this->xsltProcessor->removeParameter($namespace, $option);
         }
     }
     // Build document from transformation and return that.
     return $this->buildDocument($dom);
 }
開發者ID:jordanmanning,項目名稱:ezpublish,代碼行數:45,代碼來源:xslt.php


注:本文中的XSLTProcessor::removeParameter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。