Re: [xsl] HTML <script> tag

Subject: Re: [xsl] HTML <script> tag
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 28 Aug 2002 17:39:33 +0100
> While 1) is quicker and seems like less of a hack, what bothers me about
> this is that the resulting page will no longer have <?xml version="1.0"
> encoding="UTF-8"?> on the first line.

more importantly it will no longer be XML at all.
br will be output as <br> with no closing tag, similarly
other empty elements, & will be linearised as & not &amp; in attribute
values, etc etc.

> but what if the reader is a robot that is expecting
> to parse a valid XML document?

The xml declaration is optional in XML so <?xml ... not being there
is not a problem, but the fact that the file would not be XML would
cause the robot to die.

> Therefore, I am almost inclined to do 2) above in spite of the fact that it
> is a workaround (hack?).

It is a workaround that is required as long as you are sending XML files
to a system (IE's HTML renderer) that does not parse XML.

XSLT2 draft proposes an xhtml output method that does these hacks
automatically, along with other things required to make things work in
"legacy" browsers like putting a space before the / in <br />.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread