XSLTProcessor
PHP Manual

XSLTProcessor::transformToDoc

(No version information available, might be only in CVS)

XSLTProcessor::transformToDocDOMDocument に変換する

説明

DOMDocument transformToDoc ( DOMNode $doc )

XSLTProcessor::importStylesheet() メソッドで与えられたスタイルシートを適用し、 ソースノードを DOMDocument に変換します。

パラメータ

doc

変換されるノードを指定します。

返り値

結果の DOMDocument 。 エラーが発生した場合は FALSE

例1 DOMDocument への変換

<?php

// XML ソースをロードする
$xml = new DOMDocument;
$xml->load('collection.xml');

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

// 変換の設定を行う
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // XSL ルールを適用する

echo trim($proc->transformToDoc($xml)->firstChild->wholeText);

?>

上の例の出力は以下となります。

Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection!

参考


XSLTProcessor
PHP Manual
[お役立ちリンク集]

NPO法人の設立(東京・大阪) 東京や大阪などNPO法人を設立する場合の注意点等を紹介

不動産・賃貸・マンション 不動産・賃貸・マンションに関する用語集です。

堺市の入院・内科

大阪の賃貸探し 大阪で賃貸を探している方は大阪ホームへ

東京の賃貸マンション 東京で賃貸を探すなら東京賃貸.orgへ