xslt_process functionality question
Posted: Tue Mar 02, 2004 4:30 pm
heres the deal. Im using XSL to add/modify/remove data from an XML file. So far it works nicely, but heres the problem. when using the xslt_process function, i cant specify the same source and destination file.
So far i have been renaming the newly created file, after deleting the original. I dont like doing it that way, is there a way i can do it with the xslt_process function. Dont recommend DOM or SAX, i hate them. Anyway, XSLT is the way to go, much easier to use.
Thanks for any time you spend on this
here is an example of the way if doing the XSLT Processing
So far i have been renaming the newly created file, after deleting the original. I dont like doing it that way, is there a way i can do it with the xslt_process function. Dont recommend DOM or SAX, i hate them. Anyway, XSLT is the way to go, much easier to use.
Thanks for any time you spend on this
here is an example of the way if doing the XSLT Processing
Code: Select all
$xslt = xslt_create();
if (!$res = @xslt_process($xslt, $sourceXML, $sourceXSL, $destXML))
{
print ("Error: <b>" . xslt_error($xslt) . "</b><br/>" . "Code: <b>" . xslt_errno($xslt) . "</b>");
}
xslt_free($xslt);
print $res;