[Wylug-help] Embedding SVG directly in XHTML (Viewing in Firefox 3)

Smylers Smylers at stripey.com
Sat Aug 9 13:05:58 BST 2008


Dave Fisher writes:

> On Fri, Aug 08, 2008 at 01:58:29PM +0100, Dave Fisher wrote:
> 
> > But I really want to put the SVG code directly into XHTML, to avoid
> > unnecessary HTTP requests.
> 
> To answer my own question, the problem is that you need to jump through
> a couple of hoops to make Firefox use its XML parser instead of the
> HTML one:

That's misleading.  What you actually need to do is serve the page as
XHTML -- that is with a media type of application/xml+xhtml (rather than
text/html, which is used for HTML).

And it's a little harsh to deem labelling your content correctly as
jumping through a hoop!

>   1. Set file extension to .xhtml

It sounds like your web server was already configured to label .html as
text/html and .xhtml as application/xml+xhtml, so the above happened to
work for you.  But it's the media types that are important, not the
extension.

Smylers



More information about the Wylug-help mailing list