XML + XSLT Won’t Render in Firefox

In an attempt to create some easily customizable Kanji flashcards, I put all the class handouts into an XML file and wrote an XSLT file to transform it into HTML.

Internet Explorer was able to render the resultant HTML table, but Firefox would simply show me unformatted text. Ultimately, the problem turned out to be with my xsl:stylesheet declaration.

Good

This declaration worked under both IE and Firefox:

   <?xml version="1.0" encoding="utf-8" ?>
   <xsl:stylesheet version="1.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns:h="http://www.w3.org/1999/xhtml">

Bad

However, this version would only render under Internet Explorer:

   <?xml version="1.0" encoding="utf-8" ?>
   <xsl:stylesheet version="1.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns="http://www.w3.org/TR/xhtml1/strict">

About Jeff Fitzsimons

Jeff Fitzsimons is a software engineer in the California Bay Area. Technical specialties include C++, Win32, and multithreading. Personal interests include rock climbing, cycling, motorcycles, and photography.
This entry was posted in Technology and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *