xml-xsl-transform.php

<?php // You instantiating the XSLTProcessor - libXSLT $xmlProc = new XsltProcessor(); // Your XSLT Stylesheet for transforming XML $xslt = new DomDocument(); $xslt -> load("xsl/example.xsl"); // This prepares the XSLT for transform $xmlProc -> importStylesheet($xslt); // This is your source XML document $xml = new DomDocument(); $xml -> load("http://domain.com/example.xml"); // Run Tranform and output XML/HTML if ($output = $xmlProc -> transformToXML($xml)) { echo $output; } // If the transform fails, then it will output this statement below else { echo "<p>This feed is not available.</p>"; } ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.