aspose file tools*
The moose likes XML and Related Technologies and the fly likes   problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "  problem" Watch "  problem" New topic
Author

  problem

amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231
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
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Check out this almost identical post:

http://www.coderanch.com/t/129063/XML/entity-nbsp-was-referenced-but
amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231
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

Joined: Dec 05, 2000
Posts: 231
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

Joined: Dec 05, 2000
Posts: 231
I found the solution:

<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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

Joined: Dec 05, 2000
Posts: 231
&#160; did not work. It printed a junk character.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: &nbsp; problem