How to insert   in XSLT

Viewed 219429

How can I insert

 

Into an XSLT stylesheet, I keep getting this error:

XML Parsing Error: undefined entity

Essentially I want a non breaking space character in the XSLT Template.

12 Answers

Try to use

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

But it depends on XSLT processor you are using: the XSLT spec does not require XSLT processors to convert it into "&nbsp;".

Although answer has been already provided by @brabster and others.
I think more reusable solution would be:

<xsl:variable name="space">&#160;</xsl:variable>
...
<xsl:value-of select="$space"/>
Related