homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

Can I tell Firefox to treat an html page as xhtml?
Force FF mode to allow svg to be rendered

5+ Year Member

Msg#: 3549839 posted 4:39 pm on Jan 16, 2008 (gmt 0)

I'd like to use Firefox's ability to render SVG graphics and MathML equations. That works fine if Firefox opens a file with the tag XHTML.
Firefox and the same file but tagged HTML won't render SVG and MathML.

I'd like to overcome this by giving an extra instruction to Firefox so that I can render SVG and MathML in a file with HTML tag.

Can you tell me what that instruction would have to be?

(I generate the pages with Ruby on Rails, which generates HTML files. If you can tell me how to change Ruby on Rails to generate XHTML tags, that would work just as well for me.)

[ I find the same with IE. ]



5+ Year Member

Msg#: 3549839 posted 2:38 am on Jan 20, 2008 (gmt 0)

It all depends on how you are generating your page (static pages or dynamic). You need to declare the MIME type for the page via a HTTP header.

If the pages are dynamic, then your scripting language will surely have a way of setting the HTTP header as application/xhtml+xml, if not then you can set up Apache to send (for example) all pages ending in .xhtml with the appropriate MIME type.

Bear in mind that IE6/7 does not support application/xhtml+xml at all, although there is a way to make it support application/xml.


5+ Year Member

Msg#: 3549839 posted 8:23 pm on Jan 21, 2008 (gmt 0)

Thanks for the tip. I now believe, following your suggestion, the answer lies in getting a <meta http-equiv="Content-Type" content="#*$!" > to work.
I've tried various things for '#*$!' including "text/xhtml" and "text/html+xml". None of those works. I'm open to all suggestions.

The objective is to get Firefox to treat a file with html tag the way it would treat the same file if it had an xhtml tag. Say, "myfile.html" versus "myfile.xhtml" The files are on my desktop.

Bob Barry


WebmasterWorld Senior Member 5+ Year Member

Msg#: 3549839 posted 8:45 pm on Jan 21, 2008 (gmt 0)

something this will do it.

header('Content-Type: application/xhtml+xml; charset=UTF-8');
echo'<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>'
header('Content-Type: text/html;charset=UTF-8');
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv=content-type content="text/html;charset=UTF-8">'
<title>Page title</title>
Blah blah blah

Global Options:
 top home search open messages active posts  

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved