Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

IE rendering od XHTML error (unless...)

Back to Forum: Tech Off
  • User profile image
    aproximation

    Hello. I am trying to learn XML and XHTML but alas IE is making it difficult.
    For example if I create a index.php file that does nothing but read in and print the contents of an XHTML 1.0 Transitional index.html file:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
      <title>org test</title>
    etc...


    IE renders it as if I were looking at the source code of the file. Now if I open the index.html file directly IE renders the output relatively as it should.
    I tried to repair this functionality by using php to send HTTP headers before the source:

    header('content-type: application/xhtml+xml; charset="iso-8859-1"');
    header('content-disposition: inline; filename="index.html"');


    but to no avail. I also tired setting the content-type to text/html and text/xml, but thoes also did not work.
    Yes, I am aware (or at least heard of the work-around) that if I delete a registry key IE renders the output as it should. As I cannot go out and fix all IE users machines I am looking for a server side (or even JavaScript) fix.
    Any help would be greatly appreciated.

  • User profile image
    Harlequin

    Did you try dumping the Xml declaration?

    <?xml version="1.0" encoding="iso-8859-1"?>

    DocType should be the first line.

  • User profile image
    aproximation

    I did.
    Well, I did but I am not sure what combo I tried... One sec...

    [bad elevator music here]

    Alright, I believe the term for that is "wack as crack".

    One piece of information that I failed to mention is that I am running winXP 64-bit edition service pack 1 v. 1218, and using IE meant using the 64-bit IE which for some reason deals with files differently then the 32-bit IE (which is giving me errors I can deal with).

    So as it turns out its not an IE problem, but the 64-bit subset of IE.
    And to think, without homestarrunner (what I was watching as I ate my dinner) I might never have discovered this descrepancy.

    Now I am having weird javascript problems with functions not detecting global variables, and XMLHttpRequest()...
    Problems for another day.

    Thanks for the help! And congratulations about the whole runway model thing! I would be happy with a runway airtraffic controller if she could deal with my broken noggin.

  • User profile image
    aproximation

    Wait, now I am having another problem.
    I have these RSS 2.0 channels in basic XML. For another webpage I simply use an XSLT stylesheet to transform the RSS XML to XHTML 1.0 Transitional.
    Now without the <?xml version="1.0"?> header its not technically rss 2.0, but I cannot get IE to deal with this.

    So I can XSLT hack (somehow) the XML to remove the <?xml?> tag for IE only (barf), use PHP to pre-filter the channels output (less-barf), or figure out some other way to fix IE.

    I will resort to option one or two, unless you can help me with that preffered option three!

    You can test it out at
    audio.aproximation.org
    the index and the xslt files are both content-type text/xml

    Thank again for the help!

  • User profile image
    Harlequin

    Your link works fine in IE7. Perhaps another 64bit problem?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.