Re: [xsl] Open Meta Tag problem

Subject: Re: [xsl] Open Meta Tag problem
From: "Eric J. Bowman" <eric@xxxxxxxxxxxxxxxx>
Date: Thu, 20 May 2010 17:41:06 -0600
Karl Stubsjoen wrote:
>
> To be safe, should I add:
> 
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> 
> To my <head> tag?  If so, is there such thing as an "xhtml" content
> type?
> 

I don't know about safe, but this tag is required for your XHTML 1.0
document to validate.  This is not required in XHTML 1.1, which
requires you to use the application/xhtml+xml media type.

The difference is, text/html activates browsers' HTML rendering mode,
while application/xhtml+xml activates browsers' XML parsing mode.  XML
mode determines media type and charset differently than HTML mode.  So
only XHTML 1.0, which is meant for text/html compatibility, requires
that meta tag.

If you need to manipulate your XHTML as XML, i.e. using XML tools,
_after_ it's been rendered by the browser, then you need to use the
application/xhtml+xml media type to trigger XML mode.  Otherwise, text/
html will work fine.  The application/xhtml+xml media type still isn't
supported by IE as of IE 8, although there's some reason to hope IE 9
will have it, and therein lies the rub of using XHTML 1.1 and/or
application/xhtml+xml.

-Eric

Current Thread