[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: PHP XSL adds Content-Type meta

Subject: Re: PHP XSL adds Content-Type meta
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 08 May 2007 12:56:47 +0200
Re:  PHP XSL adds Content-Type meta
Michael Kay wrote:
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.

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.

-- Abel

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.