変換出力サンプル
sample.xsl をロードした XSLT で test.xml を変換して出力する。
<?php header('Content-Type:text/xml;charset=utf-8'); $doc = new DOMDocument(); $doc->load('test.xml'); $docxsl = new DOMDocument(); $docxsl->load('sample.xsl'); $xslt = new XsltProcessor(); $xslt->importStylesheet($docxsl); echo $xslt->transformToXML($doc); ?>