Friday, March 2, 2012

How To Add An XSL Stylesheet To PHP DOMDocument

<?php
$xslAttributes = 'href="sample.xsl" type="text/xsl"';
$xmlStylesheet = new DOMProcessingInstruction('xml-stylesheet',$xslAttributes);

$doc = new DOMDocument('1.0','UTF-8');
$doc->appendChild($xmlStylesheet);
?>

1 comment: