Re: [xslt] Removing <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> from html output



Daniel Veillard wrote:
> 
>   I checked the code and yes the meta tag is added automatically if method
> is 'html'. It's actually required by the spec in that case, see section :
>   http://www.w3.org/TR/xslt#section-HTML-Output-Method

I also saw it automatically added with xml output if the doctype was set
to XHTML 1.0 Transitional.

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

  <xsl:output method="xml" version="1.0" encoding="utf-8"
   omit-xml-declaration="no" media-type="application/xhtml+xml"
   doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
   doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";
   indent="yes"/>

  <xsl:template match="/">
    <html>
      <head>
	<title>Test</title>
      </head>
      <body>Test</body>
    </html>
  </xsl:template>

</xsl:transform>

produces the <meta> (and adds an xmlns attribute to <html> too), but
with doctype-public="-//W3C//DTD XHTML 1.1//EN" it does not.
This seems rather odd to me (although I agree that for method="html"
all bets are off).



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]