[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] xsl output defaults - html


Subject: Re: [xsl] xsl output defaults - html
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 18 Apr 2013 09:28:41 +0100

On 18/04/2013 06:48, Ihe Onwuka wrote:
Just been burnt by the fact that XSLT defaults to html output and
therefore does not emit well formed xml (e.g does not close img tags
 even if you tell it to) upon seeing a root element of html - EVEN if
 that root element is not in the html/xhtml namespace.


This rule has been in place since XSLT 1. Note you only get the html output method if the top level element is in _no_ namespace. If it is in the xhtml namespace then yiou get the xhtml method (or the xml method if xslt 1 compatibility is in force).

If producing html it is important not to use /> when generating html as
(prior to HTML5)
<meta.../>
is a syntax error in html.

David


Current Thread
Keywords