• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

  problem

 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I Am converting XML to HTML using XSL stylesheet. While conversion, I recveive following error when I write  .

error:
-----

The entity "nbsp" was referenced, but not declared.

-----


How can I resolve this issue?

Thanks.
Amit Sanghai.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this almost identical post:

http://www.coderanch.com/t/129063/XML/entity-nbsp-was-referenced-but
 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am converting XML to HTML using XSL. I declared the   entity but it did not accept it. I tried to use   but that did not work either.
 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to use <! DOCTYPE .... but that gave error: xsl:stylesheet must be declared.

I tried to use &#160; in the stylesheet, but that also did not work.
 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution:

<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using disable-output-escaping is ugly and you should avoid it wherever possible. I have always found that &#160; works as a non-breaking space; what "did not work" for you?
 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
&#160; did not work. It printed a junk character.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic