richardstan Posted December 8, 2008 Share Posted December 8, 2008 Hi, ive created an XSL Style sheet which will be associated with an XML document using the following code: $path_xml = "freedomland.xml"; $path_style = "forest.xsl"; $xml_obj = new DomDocument; $xsl_obj = new DomDocument; if(!$xml_obj->load($path_xml)){ echo "Error! Unable to open " . $path_xml. "!\n"; exit; } if(!$xsl_obj->load($path_style)){ echo "Error! Unable to open ". $path_style . "!\n"; exit; } $xslt_parse = new xsltprocessor; $xslt_parse->importStyleSheet($xsl_obj); echo $xslt_parse->transformToXML($xml_obj); however, when i try to run this PHP file, i get an error saying that the program was unable to open forest.xsl ( the name of my xsl file). The file definately exists and the code is written correctly. Windows also throws a similar error when i'm trying to load the file from Windows Explorer, "Window Cannot find 'forest.xsl'. Make sure you typed the name correctly, and then try again." but the file content will still load into Dreamweaver. Are the errorrs in my script and the Windows Explorer error in any way related? Thanks Richard. Quote Link to comment https://forums.phpfreaks.com/topic/136106-using-xsl-sheets/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.