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

Re: [xsl] tag minimisation


Subject: Re: [xsl] tag minimisation
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 11 Sep 2002 10:17:04 +0100

> The *only* problem comes from the browser (IE - no choice) failing to
> recognise <xxx/>.  Any expressions performed on a minimised element will
> crash IE, any styling given to a minimised element will be passed onto
> all elements that follow it.
> 

so you need to make th elast stage in your pipeline convert to html.
Just sending XML not using /> will cause IE to break in other places
every <br></br> will cause a blank line (ie two line breaks) for
example.

The easiest way to do an xhtml to html trasform for IE is to stick

<?xml-stylesheet type="text/xsl" href="idenity.xsl"/>

at the top of the file, where identity.xsl is an XSL identity transform
outputting using html outputmethod.

Then your document gets parsed by IEs XMl parser and rendered by its
html one and everything works.

> On large output files it can be a nightmare trying to locate which
> element has been minimised, then tracing it to the template that
> generated it and adding #160, purely to stop it getting minimised (which
> just seems rediculous)

If you want to do that you can write a simple xslt stylesheet that does
 that, or  see above.

> Its such a trivial, non essential thing that can cause so many problems,
> I fail to see why it is a problem to keep elements as <xx> </xx>, at
> least until browsers catch up.

It doesn't work. You need to output EMPTY elements as <xxx /> if you
want them to work in legacy browsers.

> That should hopefully do what I need.

yes it does what you need, not what you are asking for: it outputs <br/>
as <br /> not <br></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
Keywords