xsl-list
[Top] [All Lists]

Re: [xsl] Open Meta Tag problem

2010-05-20 18:41:59
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>