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

Re: [xsl] Closing element required instead of self closing


Subject: Re: [xsl] Closing element required instead of self closing
From: Owen Rees <owen.rees@xxxxxx>
Date: Tue, 15 Jul 2008 14:21:55 +0100

--On Tuesday, July 15, 2008 13:23:00 +0100 Andrew Welch wrote:

However they do mention XHTML in the 1.0 spec, in fact there's an
example transforming to XHTML which uses the XML output method:

http://www.w3.org/TR/xslt#section-Document-Example

Perhaps it was thought that the XML output method was sufficient?

If you are using XSLT to transform XML into something to be consumed by an HTML user agent it seems to me to make sense to use the HTML output method to generate real HTML rather than trying to generate Appendix C style XHTML in the hope that the HTML user agent will be able to cope with it.


If you are delivering content as application/xhtml+xml to an agent that understands XHTML then any valid serialisation of the XML will do just fine.

Perhaps when XSLT 1.0 was being written it was not anticipated that the dubious practice of delivering XHTML as text/html to HTML user agents would be so widespread.

If the requirement is to generate XHTML in Appendix C style then given an XSLT 2.0 processor, the xhtml output method is the answer. Attempting to extend the Appendix C tricks to some other form of XML will create an instant legacy system.

--
Owen Rees; speaking personally, and not on behalf of HP.
========================================================
Hewlett-Packard Limited.   Registered No: 690597 England
Registered Office:  Cain Road, Bracknell, Berks RG12 1HN


Current Thread
Keywords