Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    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

  • Users who have thanked Alex Vincent for this post:

    Lauwerier (10-01-2008)

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #4
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @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.

  • #5
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    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

  • #6
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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)


  •  

    LinkBacks (?)


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •