Solvegen articles

Archives by date

Search in Blog

Contact information

Solvegen, Inc
Phone: +1 310 929 5205
E-mail: info@solvegen.com
Web: www.solvegen.com
Skype: solvegen
MSN: solvegen@hotmail.com

How can I make insert a space character ( ) into my html output from the xsl?

I tried so:

<xsl:text> <xsl:text> — have no space character in html code;
<xsl:text>&nbsp;<xsl:text> — don’t work, XSLT processor error “Entity ‘nbsp’ not defined.”;
<xsl:text>&amp;nbsp;<xsl:text> — obtained &amp;nbsp; in html code, but no space character;
<xsl:text><![CDATA[ ]]> <xsl:text> — have no space character in html code;
<xsl:text><![CDATA[&]]>nbsp; <xsl:text> — &amp;nbsp; in html code, but no space character;
<xsl:text><![CDATA[&nbsp;]]> <xsl:text> — &amp;nbsp; in html code, but no space character;

Finaly, I decided this by inserting <![CDATA[&nbsp;]]> into XSLT, and then seting attribute “disable-output-escaping” in XSLT to “yes”. But I suppose this solution is not the best one.

Сorrect code: <xsl:text disable-output-escaping=”yes”><![CDATA[&nbsp;]]></xsl:text>

Tags:

This entry was posted on Tuesday, June 16th, 2009 at 1:49 pm and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “How can I make insert a space character (&nbsp;) into my html output from the xsl?”

  1. Andrew Senn says:

    You can use the character code:  

    I hope this helps… and saves you some typing! :)

Leave a Reply