Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Using browser XSLT transformations
April 10, 2006, 5:33 pm
rate this thread
span a few topics.
I have a PHP page that generates XML output. I want to push this output
through a stylesheet transformation and display this to the user. I
know the transformation is sound because if I save the output as a .xml
file it renders fine. However, the PHP page is displayed as raw text
without even line breaks. I suspect that because the extension for the
page is .php the browser does not know to treat it as XML and apply the
stylesheet. Is it possible to force the browser to do this?
Once I have this working, I would then like to embed the XML into a
larger page generated by PHP. Will the browser be able to only
stylesheet-process the XML portion of the page and leave the rest
Any general suggestions on how to embed stylesheet-transformed XML into
a web page? I know I can use the XML XSLT routines to hand-crank the
transformation, but leaving the XML as it is and getting the browser to
transform seems a lot cleaner.
- Juan JosÃ© GutiÃ©rrez de Quevedo PÃ©rez
April 10, 2006, 7:11 pm
Re: Using browser XSLT transformations
you have to generate the header to change the default mime-type to
header('Content-type: application/xml; charset=utf-8 ');
Juan José Gutiérrez de Quevedo
Director Técnico (firstname.lastname@example.org)
ITEISA (http://www.iteisa.com )
942544036 - 637447953
- » error_reporting(E_ALL & ~E_NOTICE) reports a million lines of notices and warnings
- — Previous thread in » PHP Scripting Forum