August 2005 Archives

IE still bites - xhtml script tags

| No Comments | No TrackBacks

I rarely use IE except for testing. Lots of reasons for that, and I won't waste your time with that.

Today someone came to me saying they couldn't see our new help in IE. It worked fine for me in Firefox and Opera, but not in IE. In IE, there was nothing rendered, but if you viewed the source, you could see all the XHTML source. After spending a bit of time trying to diagnose what was going on, I figured out that it was the script tags.

In IE, you cannot use XML style empty script tags.

An empty tag is a tag with no text content. For example, a [code]
[/code] in HTML. In XML, all elements have to have a start and end tag, so that [code]
[/code] tag wouldn't be valid. Instead you do it this way, [code lang="xml"]
[/code] Notice the "/" before the closing bracket. That's just like doing this: [code lang="xml"]

[/code]

A script tag in XHTML looks like this [code lang="xml"][/code]

Now the fun part. I'm converting to XHTML from XML. XSLT processors convert [code lang="xml"][/code] to [code lang="xml"]