Jump to content

Using XSL Sheets


richardstan

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.