xsl-list
[Top] [All Lists]

RE: [xsl] PHP XSL adds Content-Type meta

2007-05-08 02:31:59
XSLT 1.0 specifies that when you use the HTML output method, the serializer
will add a <meta> element containing the media type and encoding. This
normally causes no problems, because the encoding is known at this point
(it's the responsibility of the serializer to get it right). XSLT 2.0
however does allow you to switch this behaviour off using <xsl:output
include-content-type="no"> - this can be useful if you want to transcode the
document after serialization and before HTTP delivery.

Your snippet suggests you are using method="xml"; if that's the case then no
<meta> element should be added.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Martynas Jusevicius 
[mailto:martynas(_dot_)jusevicius(_at_)gmail(_dot_)com] 
Sent: 08 May 2007 09:44
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] PHP XSL adds Content-Type meta

Hi all,

I'm using PHP's XSL extension (which uses libxsl, AFAIK).
When I specify

    <xsl:output method="xml" encoding="UTF-8" indent="yes"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>

the processor adds

    <meta http-equiv="Content-Type" content="text/html; 
charset=UTF-8" />

to the output. This is not needed, because the encoding is 
not known at this point and negotiated later according to the 
HTTP headers. For the same reason I cannot specify it 
directly in the <xsl:output>.
Is it possible to turn this feature (bug?) off?

Thanks,

Martynas

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--