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

Re: Self-closing elements upset some browsers

Subject: Re: Self-closing elements upset some browsers
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 14 Mar 2008 14:46:57 +0100
Re:  Self-closing elements upset some browsers
Marroc wrote:

I am importing legacy into a 3rd party tool and I find my self in the
situation where I need valid XHTML _and_ end-tags - this is not my decision.
I tried using the <xsl:output method="html"> but it inserts <meta> without a
closing tag and the file becomes invalid xml and subsequently fails to
import.

Well xsl:output method="html" is for HTML 4, not for XHTML.
As said, for XHTML to be served as text/html you would need xsl:output method="xhtml" but that is only supported by XSLT 2.0 processors.



Incidentally David, the problem with empty script elements, that is <script
href="" /> style, was exhibited by Firefox. It basically missed the end-tag
and assumed everything was script until the closing tag of an actual
non-empty script further down the file. It (very usefully) also showed this
behaviour in the syntax highlighting of it's source viewer.

The proper MIME type for XHTML is application/xhtml+xml, if you serve your XHTML with that Content-Type then Firefox uses its XML parser and I am sure it will not have any problem with <script/>.
The problem is that you serve your XHTML as text/html and then the browser uses its HTML parser and parses according to SGML rules and not XML rules. Therefore to serve XHTML as text/html the W3C recommends the following rules <URL:http://www.w3.org/TR/xhtml1/#guidelines> and xsl:output method="xhtml" enforces these rules.



--


	Martin Honnen
	http://JavaScript.FAQTs.com/

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.