Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-01-2008, 03:28 PM   PM User | #1
Lauwerier
New to the CF scene

 
Join Date: Oct 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Lauwerier is an unknown quantity at this point
Angry Firefox does not show my XML/XSLT output

Probably this is a FAQ, but I am not able to find the answer:
Firefox does not show my XML/XSLT output
I have just been succesful in creating HTML-forms from PHP-script using XML/XSLT under Windows/IExplorer. My test page is www.lauwerier.nl/PHPJules/test.xml

My HTML-forms but do not show in my current Firefox-environment (neither FF2/WindowsXP nor FF3/KubuntuLinux).

Under FF3 using ViewPageSource (Paginabron bekijken in Dutch) I see the XML-page I expected to be correct. Using a right-click and choosing "View Transformed XML Source" I get the HTML-code I expected (I use XSL Result 1.56 as add-on to get the option "View Transformed XML Source").

Why does my Firefox-browser does not show the interpreted Transformed XML Source ? I suspect that something needs to be done in the header or mime-type, but I cannot find the correct clue.
Lauwerier is offline   Reply With Quote
Old 10-01-2008, 08:29 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,428
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Your html element has no namespace. It's not XHTML, therefore.

I'm looking for
Code:
xmlns="http://www.w3.org/1999/xhtml"
here:
http://www.lauwerier.nl/PHPJules/200..._formulier.xsl
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Users who have thanked Alex Vincent for this post:
Lauwerier (10-01-2008)
Old 10-01-2008, 09:02 PM   PM User | #3
Lauwerier
New to the CF scene

 
Join Date: Oct 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Lauwerier is an unknown quantity at this point
Smile Thanks. Solution posted.

Thanks,

I just changed <html> to <html xmlns="http://www.w3.org/1999/xhtml"> in my XSL which solves my problem.
Lauwerier is offline   Reply With Quote
Old 10-02-2008, 10:12 PM   PM User | #4
Lauwerier
New to the CF scene

 
Join Date: Oct 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Lauwerier is an unknown quantity at this point
@Alex: It seems I still have not solved it all. Please compare the page source of http://www.lauwerier.nl/PHPJules/200...hp?plaats_nr=3 with the page source of http://www.lauwerier.nl/PHPJules/test2.xml
What is the difference ? They both use the same XSL !
Please help again.
Lauwerier is offline   Reply With Quote
Old 10-03-2008, 06:11 AM   PM User | #5
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,428
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Not enough to go on here, I'm afraid. Might be one's being served as text/html from your web server, and the other as application/xml. That's a very uneducated guess, though.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Old 10-03-2008, 10:00 PM   PM User | #6
Lauwerier
New to the CF scene

 
Join Date: Oct 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Lauwerier is an unknown quantity at this point
Smile

Solution seems to be:
Adding the following lines to my PHP-script:

header('Content-Type: text/xml, charset=utf-8');
header('Content-Disposition: inline; filename=mijndummy.xml');

The second seems to be required for IExplorer. The reason is given in a post I found on http://nl3.php.net/header:

dracolytch at yahoo dot com
10-May-2007 06:00
You may find that you want to process a PHP file, and have the browser treat the output as an XML file. Unfortunately, most browsers will only do this if the file extension is ".xml"

In those situations where you can't/don't want to change your apache config to put XML files through the PHP processor, you can use the header function to change the output to something the browser will recognise as XML:

header('Content-Type: text/xml');
header('Content-Disposition: inline; filename=sample.xml');

(The inline portion helps ensure the browser renders the page itself, instead of prompting the user to download the page)
Lauwerier is offline   Reply With Quote
Reply

Bookmarks

Tags
firefox, iexplorer, rendering, xslt

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:11 AM.


Advertisement
Log in to turn off these ads.