Nate's Programming Blog

Ran into a little problem today that pretty much consumed my entire day. I’m working on an application that connects with a service to retrieve domain and report data. It takes xml that it receives and transforms it into html using XSLT. Pretty standard stuff, but it is my first time using XSLT. I learned what I needed to know about XSLT pretty quickly and I feel pretty comfortable working with it now. Then today I decided to up my standards to xhtml since the html has to be valid xml in order to be parsed by the xslt transformer. I did some research and made the necessary modifications to the xslt and loaded the page and it was blank. I then started researching what I was doing wrong and trying several different solutions including tweaking meta tags, applying the xml declaration, omitting the xml declaration, providing a namespace, all to no avail. I then downloaded firefox and loaded the page and it worked just fine. I decided at that point that it had to be some sort of content type issue, so with some suggestions from James and Ryan I started experimenting with different content types that also produced no results. At long last James discovered the problem. In my code I was performing a javascript include like this:

<script type=”text/javascript” src=”blah.js”></script>

Just a standard javascript include, but the java transformer converted it to this:

<script type=”text/javascript” src=”blah.js” />

At first glance I saw nothing wrong with this, but IE doesn’t handle script includes formatted like this. It simply doesn’t render the page. Therefore I added an encoded space between the open and close script tag and all was well. This is just another reason why I hate IE.


This entry was posted on Thursday, June 9th, 2005 at 11:48 pm and is filed under Web Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
2 Comments so far

  1. James on June 10, 2005 5:49 am

    Basically, IE is not understanding that the script has ended and the entire page is included as part of the script. It really is a nasty bit.

  2. Nate on June 12, 2005 8:24 am

    When IE 7 comes out with Longhorn, they better do a better job of adhering to standards. It would be nice if they had strict compliancy to standards and forced web developers to stick to them.

Name (required)

Email (required)

Website

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Feel free to leave a comment

top