xsl-list
[Top] [All Lists]

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

2008-10-16 10:42:37
At 2008-10-16 15:31 +0100, Andrew Welch wrote:
> Not sure what you mean by "minimization" in this case.

I mean <div/> where <div></div> has been "minimized" to the empty
syntax... I thought it was the right terminology?

Yes, that is end-tag minimization. There are many aspects of markup minimization and I didn't know which one you were after. But I wasn't sure you were even talking about markup minimization since that is typically irrelevant to the browser, thinking perhaps you might be talking about avoiding the minimizing of table borders.

Why not just <xsl:comment/> to inject "<!---->"?

  <div><xsl:comment/></div>

That is character set independent.

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.

Good point... the "target browser" are XHTML based mobile phones...
but I would expect that if the browser can display XHTML then it must
support unicode?

I couldn't say ... because XHTML still has a character set declaration in META elements, a subset of Unicode might still be specified by a page or perhaps assumed by a user agent.

I hope this helps.

. . . . . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg
Video course overview:  http://www.youtube.com/watch?v=VTiodiij6gE
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
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>
--~--