Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Get the race id selected by the user - to be passed to xslt
- $id = $_GET["raceid"];
- //Process the data using XSLT Processor
- //Create an instance of the XSLT Processor
- $xp = new XsltProcessor();
- //Create a DOM document and load the XSL
- $xsl = new DomDocument;
- $xsl->load('resx/resultDetails.xsl');
- //Import the XSL into the processor
- $xp->importStylesheet($xsl);
- //Create a DOM document and load the XML
- $xml_doc = new DomDocument;
- $xml_doc->load('resx/F1Results.xml');
- $xp->setParameter($namespace, 'id', $id);
- //Pass the ID Parameter
- //Transform the XML into HTMl using XSL Rules
- if ($html = $xp->transformToXML($xml_doc))
- {
- echo $html;
- }
- else
- {
- trigger_error('XSL transform failed.',E_USER_ERROR);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement