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


PHP XSLTProcessor::transformToUri方法代码示例

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


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

示例1: xsl

 /**
  * Transformation xsl
  */
 static function xsl($xslFile, $dom, $dest = null, $pars = null)
 {
     $xsl = new DOMDocument("1.0", "UTF-8");
     $xsl->load($xslFile);
     $proc = new XSLTProcessor();
     $proc->importStyleSheet($xsl);
     // transpose params
     if ($pars && count($pars)) {
         foreach ($pars as $key => $value) {
             $proc->setParameter('', $key, $value);
         }
     }
     // we should have no errors here
     if ($dest) {
         $proc->transformToUri($dom, $dest);
     } else {
         return $proc->transformToXML($dom);
     }
 }
开发者ID:dramacode,项目名称:tools,代码行数:22,代码来源:Transform.php

示例2: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     echo "generate frontend";
     echo "\n";
     /**
      * cvmanager build
      *
      * take the xml data
      * take the xslt
      * build index.html
      */
     $xslFile = getcwd() . "/mycv.xslt";
     $xmlFile = getcwd() . "/data.xml";
     $xslDoc = new \DOMDocument();
     $xslDoc->load($xslFile);
     $xmlDoc = new \DOMDocument();
     $xmlDoc->load($xmlFile);
     $proc = new \XSLTProcessor();
     $proc->importStylesheet($xslDoc);
     $proc->transformToUri($xmlDoc, 'file://' . getcwd() . '/frontend/mycv/index.html');
 }
开发者ID:alexlebesc,项目名称:cvmanager,代码行数:21,代码来源:BuildFrontend.php

示例3: testTransformToUri

 public function testTransformToUri()
 {
     $xslDoc = new DOMDocument();
     $xslDoc->load('Stubs/collection.xsl');
     $xmlDoc = new DOMDocument();
     $xmlDoc->load('Stubs/collection.xml');
     $native = new \XSLTProcessor();
     $native->importStylesheet($xslDoc);
     $native->transformToUri($xmlDoc, 'php://temp');
     $nativeResult = file_get_contents('php://temp');
     $transpiler = new XsltProcessor();
     $transpiler->importStylesheet($xslDoc);
     $transpiler->transformToUri($xmlDoc, 'php://temp');
     $transpilerResult = file_get_contents('php://temp');
     $this->assertEquals($nativeResult, $transpilerResult);
 }
开发者ID:genkgo,项目名称:xsl,代码行数:16,代码来源:ProcessXslt1DocumentsTest.php

示例4: transformToUri

 /**
  * @param DOMDocument|SimpleXMLElement $doc
  * @param string $uri
  * @return int
  */
 public function transformToUri($doc, $uri)
 {
     $styleSheet = $this->styleSheetToDomDocument();
     $transpiler = $this->createTranspiler($styleSheet);
     parent::importStylesheet($this->getTranspiledStyleSheet($transpiler, $styleSheet));
     return $transpiler->transform(function () use($doc, $uri) {
         return parent::transformToUri($doc, $uri);
     });
 }
开发者ID:Samshal,项目名称:xsl,代码行数:14,代码来源:XsltProcessor.php

示例5: Getopt

    $opts = new Getopt($rules);
    $opts->parse();
} catch (Console\Exception\RuntimeException $e) {
    exitWithMessage($e->getMessage(), $e->getUsageMessage(), 1);
}
if ($opts->getOption('h')) {
    exitWithMessage('tdconv <testdox.html.file.name> <output.file.name>', $opts->getUsageMessage(), 0);
}
$title = false;
$args = $opts->getArguments();
if ($opts->getOption('t')) {
    $title = $opts->getOption('t');
    unset($args['title']);
}
if (count($args) !== 2) {
    exitWithMessage('Expected exactly two arguments, got ' . count($args), $opts->getUsageMessage(), 1000);
}
$testdoxFile = $args[0];
$outputFile = $args[1];
//get the xml translation
$xsldoc = new \DOMDocument();
$xsldoc->load(dirname(__FILE__) . '/xsl/tdconv.xsl');
$xmldoc = new \DOMDocument();
$xmldoc->loadHTMLFile($testdoxFile);
$xsl = new \XSLTProcessor();
$xsl->importStyleSheet($xsldoc);
if ($title !== false) {
    $xsl->setParameter('', 'title', $title);
}
$xsl->transformToUri($xmldoc, $outputFile);
开发者ID:chippyash,项目名称:testdox-converter,代码行数:30,代码来源:tdconv.php


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