PDA

View Full Version :   Vs  



Stubbs
9 Nov 2006, 6:33 AM
I've run into an interesting little problem in the way that I use YUI.ext ...

We use XSLT to transform data returned from web services into web pages, but rather than return html, we set the content-type to application/xhtml+xml.

Now, all is fine until I tried to implement paging, and I started to get errors about not being a recognised entity. Turns out, this was coming from basic-grid-lib.js.

I tried to add an entity definition in the DOCTYPE for the stylesheet, but by default asp.net prohibits this. The easiest solution for me was to simply replace all the problem entities in the source with  

Is there any overriding reason behind this? Is there any reason not to just use   in the source?

jack.slocum
9 Nov 2006, 6:41 AM
The only real reason is &nbsp is standard HTML and I've been using it for years. There's no reason I can't replace them with &#160 if you know for certain it works a) in all browsers, b) it always has the same effect.

Stubbs
10 Nov 2006, 12:42 AM
is, as I understand it, just an alias for   anyway, set up but the XHTML DTD, so yes it will work in all browsers and will behave exactly the same as

brian.moeskau
17 Nov 2006, 2:16 PM
+1 for using & #160; I've had this problem in the past as well and AFAIK, it should work in all browsers equivalently. And yes, using is an issue for those of us also using Visual Studio because of doctype restrictions.

jack.slocum
17 Nov 2006, 7:44 PM
I just went through and replaced all &nbsp with &#160.

SteveEisner
20 Nov 2006, 12:19 PM
Just one warning: &#160 and &nbsp are identical except when Unicode breaks. IE has certain cases in which auto-detection of character encoding will fail, and users will see an accented capital A rather than a non-breaking space.

I wish I knew more about what causes it (and how to avoid it) but it's been a while since I encountered the problem!