首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

XSLTProcessor::transformToUri

(PHP 5, PHP 7)

XSLTProcessor :: transformToUri - 转换为URI

描述

代码语言:javascript
复制
int XSLTProcessor::transformToURI ( DOMDocument $doc , string $uri )

将源节点转换为应用由 XSLTProcessor :: importStylesheet()方法给出的样式表的 URI。

参数

doc

要转换的文件。

uri

转换的目标URI。

返回值

返回写入的字节数或FALSE发生错误的次数。

示例

示例#1转换为 HTML 文件

代码语言:javascript
复制
<?php

//?Load?the?XML?source
$xml?=?new?DOMDocument;
$xml->load('collection.xml');

$xsl?=?new?DOMDocument;
$xsl->load('collection.xsl');

//?Configure?the?transformer
$proc?=?new?XSLTProcessor;
$proc->importStyleSheet($xsl);?//?attach?the?xsl?rules

$proc->transformToURI($xml,?'file:///tmp/out.html');

?>

也可以看看

  • XSLTProcessor :: transformToDoc() - 转换为 DOMDocument
  • XSLTProcessor :: transformToXml() - 转换为 XML

← XSLTProcessor::transformToDoc

XSLTProcessor::transformToXML →

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com