Re: [xsl] Understanding why <tag></tag> is the way it is (was Re: [xsl] IE Client side transformation issue)

Subject: Re: [xsl] Understanding why <tag></tag> is the way it is (was Re: [xsl] IE Client side transformation issue)
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 3 Aug 2007 10:21:48 +0100
On 8/3/07, M. David Peterson <m.david@xxxxxxxxxxxxx> wrote:
> NOTE: While this may seem off-topic for XSL-List, I would argue that based
> on the various problems associated with the rendering of HTML via an XSLT
> transform and <tag></tag> and <tag/> this is really and important topic
> closely related to XSLT from several different perspectives.

The key thing to remember here is the problems are caused by the
browser parsing the XML with an SGML browser, which is why

<b/>abc

...is rendered as bold in a browser.

A while back I used to ask frequently why we couldn't have a switch to
tell the serializer to output <b/> as <b></b> and the general response
was "why?"...

My point was that if it made no difference to the XML parser (but a
big difference in the Real World) then why not?

In the end though it was my problem, and the solution was to ensure
the final transform in the chain used the HTML output method (and then
the XHTML output method came along and the problem went away).

So in summary, the answer is to parse HTML with an SGML parser, and
XML with an XML parser and be aware which one the browser is using to
parse what you've given it.

(It think it was DC that enlightened me here)

-- 
http://andrewjwelch.com

Current Thread