xsl-list
[Top] [All Lists]

Re: [xsl] zero width no-break space to prevent tag minimisation

2008-10-16 11:04:50
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--