View Single Post

  #10 (permalink)  
Old 09-06-2004
Hayko Riemenschneider
 
Posts: n/a
Default Re: XSLT processing instruction to use PHP

On 06.09.2004 14:09, Berislav Lopac wrote:
> Hayko Riemenschneider wrote:
>> Isn't there an another way to PHP parse the XML or XSL file before
>> it gets XML/XSLT parsed?

>
> Sure, just give them an .php extension. If you do your
> transformations client-side, chance is that some browsers, like IE,
> won't recognize the files as XML


This is the case, and I was hoping to do all the XSLT client-side. But
that won't work along with the PHP. Especially since the browser won't
make that callback to ask for the PHP evaluation.

> -- in that case, and if you're running the scripts off Apache with
> MultiView enabled, add the .php extension to their normal extensions
> (i.e. file.xml.php and file.xslt.php) and call them without the .php
> (e.g. file.xml).


That's actually quite nifty. I could use a dummy PHP script to process
the .xml file and then spit it out as output to the browser for the
client-side transformation.

Thanks for the hint!
hayko
Reply With Quote