Re: PHP XSL adds Content-Type meta
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.
Ah, my apologies for supplying incorrect or incomplete information.
So, it appears to be a libxsl bug after all: using doctype and method='xml' causes libxsl to incorrectly output the <meta> element.
Interestingly, there's another oddity. You specify that the output contains an extra:
<meta http-equiv="Content-Type" ... />
whereas, when the output is considered html (as libxsl seems to think), it should output:
<meta http-equiv="Content-Type" ... >
instead (no closing tag or slash). So, as it is, the libxsl processor is mixing xml and html: it adds an element that should be added in html mode, and it leaves the tags as in xml: nicely closed, even when these are empty tags and should be output without end-tag.
IMHO, this is an libxsl feature, not a bug: it recognizes XHTML doctype and outputs all elements as XML (with closing tags) and adds the <meta> as it would do with html. But it is not what it should do, of course.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format