|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Inserting White Space ( ) through XSL.
Animesh,
At 03:44 AM 5/3/2004, you wrote: Quoted from some Site: What Some Site isn't telling you is why this works. It works because "&_nbsp;" (no underscore) is a general entity in HTML, which represents a particular Unicode character, the non-breaking space, which combines two necessary features. First, since it is not a regular whitespace character (in HTML these are the carriage return, the tab and the regular space characters), it is not "munged" or collapsed in the display. This is what accounts for the border on a table cell in which this character appears alone. (If you have only a plain space, your border doesn't appear, which is why there's a problem in the first place.) But just as importantly, unlike other characters that count as non-whitespace content, this character *looks like* space. This character can be represented straightforwardly in XML using a Unicode character reference for its code point: &_#xA0; (if you like hexadecimal numbering) or &_#160; (if you prefer decimal numbering) -- both times with no underscore character in there (if I type them properly at least some people's mailers will say "oh a non-breaking space", and display them as spaces). Going by above quotation I tried getting in the output. And I got that using using <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>. You can use the &_nbsp; general entity in well-formed XML if you declare it (you would provide a declaration to tell your system that when you say "&_nbsp;" you mean "&_#160;"), but XSLT 1.0 has no provision for providing such declarations in output. May be I have to find some alternative solution for the above problem. The alternative solution would be simply to use the straight character reference instead of the general entity. That is -- as has been suggested -- you use &_#160; instead of the error-prone workaround using disable-output-escaping. Many of us do this routinely, so we know it works. Anyone who tells us that it doesn't has a little explaining to do. If & # 1 6 0 ; doesn't work for you, you're doing something else wrong, or your situation is different from the general case in some important but unspecified way. I hope that helps, Wendell
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








