Subject: Re: [xsl] zero width no-break space to prevent tag minimisation From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Thu, 16 Oct 2008 16:04:17 +0100 |
> I use that in an application where I have optional content and I'm > decorating that content with colour ... there is a bug in IE that the > formatting properties of a "<div/>" bleed to the end of the page, whereas > they don't if I have "<div></div>" so I use: > > <div colour,etc> > <xsl:value-of select="..."/> > <xsl:comment/> > </div> > > This guarantees the production of the end tag. I don't think it's a bug... as far as I understand, IE will always use its SGML parser regardless of whether its parsing html or xhtml, and because of that <div/> is always seen as just an opening tag (because its not defined as #EMPTY), so any styles given to that div will apply to everything that follows it... hence the need to suppress the minimization and have an explicit closing tag. Even in XHTML, div shouldn't be minimized - the XHTML output method will always output <div></div> so you don't get this problem even if it is ultimately parsed with an SGML parser. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] zero width no-break space, G. Ken Holman | Thread | Re: [xsl] zero width no-break space, Colin Paul Adams |
Re: [xsl] zero width no-break space, G. Ken Holman | Date | Re: [xsl] zero width no-break space, Colin Paul Adams |
Month |