Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1241
  • Last Modified:

What is the syntax for &nbsp in XSLT?

I am working on xslt form and I need to create a space like a new line or a retune on my page but it doesn't like the normal html syntax of &nbsp and I was just wondering how would you do this in xslt?
Thanks in advance for all the help.
1 Solution
Geert BormansCommented:
Hi sabrina_spillane,

by putting the   in the document,
you are using an undefined entity

there are two options to solve this issue

1. make a definition for the entity, by adding a DOCTYPE and the ENTITY definition, like this

<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"; version="1.0">

2. just use &#160; directly, instead of &nbsp;
if you use &#160; in an XML file, you enter the 160th character of unicode, which is the non breaking space


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now