Re: [xsl] Self-closing elements upset some browsers

Subject: Re: [xsl] Self-closing elements upset some browsers
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 14 Mar 2008 14:21:55 GMT
> Incidentally David, the problem with empty script elements, that is <script
> href="" /> style, was exhibited by Firefox.

If you send the file as text/html firefox will parse it as html (and the
above is an html syntax error)

If you send (an identical) file as text/xml or application/xhtml+xml or
related x(ht)ml mime types firefox will parse it as xml and render it as
xhtml.

A more (or as) significant difference is that HTML's script element is
CDATA so (if you are using the form with inline script in the element
content)you can write a javascript numeric test as a < b but xhtml's
script element is PCDATA so the test has to be written a &lt; b .
(again there are tricks with comment and <![CDATA[ syntax to make the same
file valid for both uses, if you must)

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread