XSL XSLTProcessor::transformToUri
(PHP 5, PHP 7, PHP 8)
XSLTProcessor::transformToUri — Transform to URI
설명
public XSLTProcessor::transformToURI(DOMDocument $doc
, string $uri
): int
XSLTProcessor::importStylesheet() 메서드에서 제공한 스타일시트를 적용하여 소스 노드를 URI로 변환합니다.
매개변수
doc
- 변환할 문서입니다.
uri
- 변환의 대상 URI입니다.
반환 값
쓴 바이트 수를 반환하거나 오류가 발생한 경우 false
를 반환합니다.
Examples
예제 #1 HTML 파일로 변환
<?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로 변환