Re: [xsl] xslt newbie- inserting spaces

Subject: Re: [xsl] xslt newbie- inserting spaces
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Aug 2003 13:14:41 -0400
At 2003-08-15 15:26 -0600, Bruce Rojas-Rennke wrote:
  I'm wanting to insert spaces via my xslt stylesheet, so the html output
has some blank spaces where I want them.

All I've read suggests that i can just include this :
<xsl:text>   </xsl:text>

- doesn't work for me,

Probably because HTML collapses normal spaces.


nor do these variants help:

<xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>

You don't say what error messages you are getting, but the above should work, provided you have the following at the top of your stylesheet:


  <!DOCTYPE xsl:stylesheet
  [
  <!ENTITY nbsp "&#xa0;">
  ]>

Alternatively, you could just do:

<xsl:text>&#xa0;&#xa0;&#xa0;&#xa0;</xsl:text>

<xsl:text disable-output-escaping="yes">

That is irrelevant in your situation and in any case should be avoided and only used as a very last resort.


The key is to establish, probably manually, in a standalone HTML file exactly what markup you need to get the effect you want, and then you'll know what markup you need in your stylesheet to get the desired result.

I hope this helps.

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


-- Instructor-led on-site corporate, government & user group training for XSLT and XSL-FO world-wide; please contact us for the details; Next public European delivery: 3-day XSLT/2-day XSL-FO 2003-09-22

G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                       Definitive XSLT and XPath
ISBN 0-13-140374-5                               Definitive XSL-FO
ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:     http://XMLGuild.info
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread