当前位置: 首页>>代码示例>>PHP>>正文


PHP XSLTProcessor::registerPhpFunctions方法代码示例

本文整理汇总了PHP中XSLTProcessor::registerPhpFunctions方法的典型用法代码示例。如果您正苦于以下问题:PHP XSLTProcessor::registerPhpFunctions方法的具体用法?PHP XSLTProcessor::registerPhpFunctions怎么用?PHP XSLTProcessor::registerPhpFunctions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XSLTProcessor的用法示例。


在下文中一共展示了XSLTProcessor::registerPhpFunctions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DOMDocument

 * LICENCE
 * OPUS is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the Licence, or any later version.
 * OPUS is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details. You should have received a copy of the GNU General Public License 
 * along with OPUS; if not, write to the Free Software Foundation, Inc., 51 
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * @category    Application
 * @author      Ralf Claussnitzer <ralf.claussnitzer@slub-dresden.de>
 * @copyright   Copyright (c) 2009, OPUS 4 development team
 * @license     http://www.gnu.org/licenses/gpl.html General Public License
 * @version     $Id$
 */
$args = $GLOBALS['argv'];
if (count($args) < 3) {
    echo 'Usage: ' . $args[0] . ' PathToXsl PathToXml' . "\n";
    exit;
}
$xslt = new DOMDocument();
$xslt->load($args[1]);
$xml = new DOMDocument();
$xml->load($args[2]);
$proc = new XSLTProcessor();
$proc->registerPhpFunctions();
$proc->importStyleSheet($xslt);
error_reporting(0);
echo $proc->transformToXml($xml);
开发者ID:belapp,项目名称:opus4-application,代码行数:31,代码来源:xslt.php

示例2: start

 /**
  * Public Method for import of Institutes
  *
  * @param void
  * @return void
  *
  */
 public function start()
 {
     $role = Opus_CollectionRole::fetchByName('institutes');
     $xml = new DomDocument();
     $xslt = new DomDocument();
     $xslt->load($this->_stylesheetPath);
     $proc = new XSLTProcessor();
     $proc->registerPhpFunctions();
     $proc->importStyleSheet($xslt);
     $xml->loadXML($proc->transformToXml($this->_data));
     $doclist = $xml->getElementsByTagName('table_data');
     foreach ($doclist as $document) {
         if ($document->getAttribute('name') === 'university_de') {
             $this->importUniversities($document);
         }
         if ($document->getAttribute('name') === 'faculty_de') {
             $facNumbers = $this->importFaculties($document, $role);
         }
         if ($document->getAttribute('name') === 'institute_de') {
             $instNumbers = $this->importInstitutes($document, $facNumbers);
         }
     }
 }
开发者ID:hauschke,项目名称:migration,代码行数:30,代码来源:Opus3InstituteImport.php

示例3: reader

 <?php 
// Page header
echo "<html><head>\n";
echo "<title>ATOM reader (PHP + XSLT)</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>\n";
echo "<head><body>\n";
echo "This ATOM reader is coded in PHP5+XSLT, using libxslt.<br/>\n";
// Get parameters
$url = $_GET['url'];
$xsl = $_GET['xsl'];
// Load ATOM file
$xmldoc = new DOMDocument();
$xmldoc->load($url);
// Load XSLT file
$xsldoc = new DOMDocument();
$xsldoc->load($xsl);
// Register PHP functions as XSLT extensions
$xslt = new XSLTProcessor();
$xslt->registerPhpFunctions();
// Import the stylesheet
$xslt->importStylesheet($xsldoc);
// Transform and print
print $xslt->transformToXML($xmldoc);
开发者ID:Residentik,项目名称:sploit-dev,代码行数:23,代码来源:vuln.php


注:本文中的XSLTProcessor::registerPhpFunctions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。