My environment is:
Linux : MySQL 4.1.x : PHP5
I am working on a system where I would be abel to seperate Application/Data and presentation.
My current plan is to have PHP build the XML document. And then have a seperate static XSL to transform it.
Everything is well when I let the cient handle the transformation. (as I can configure apache to send .xml files through the PHP parser) But I would like to use PHP's built in XML-XSL transformer to form the xhtml for old browser compatibility.
I can't seem to figure out how to get my PHP fiel to produce the XML output and still be read by the xsltprocessor.
I don't want actually write to an XML file, because this script will actually generate the XML output every time the script is called.
I am looking (with no luck) for a way that I can parse a file.php to a string. (I tried using the output buffer, but I soon found that callign the buffer twice was a really bad idea)
Here is the code that I have.
/* Load the two XML sources */
$xml = new DomDocument; // from /ext/dom
$xml->load('test.php'); //I want this test.php to be run through the PHP engine so I get the XML that it is intended to output.
$xsl = new DomDocument;
$xsl->load('index.xsl');
/* Configure the transformer */
$proc = new xsltprocessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml); // actual transformation
If anyone has a better idea for doing the same thing, I would welcome that as well.
Thanks for the help (In advance)
-leet.box