Subject: (dsssl) Jade keeps translating non-breaking space to a regular space in HTML From: Tim McDaniel <tmcd@xxxxxxxxx> Date: Mon, 31 Mar 2003 01:47:03 -0600 (CST) |
Old versions of Netscape has a problem, I'm told, with table cells with no contents. In the past, I've pandered to that by putting in a non-breaking space as the only contents of the cell. (<br> also works, I think, but I'd like to avoid breaks just in case some browser decides to display the cell with two lines or something.) Here's the DSSSL code I'm calling. "columns" is the number of columns in the table. (make element gi: "TR" (make element gi: "TH" attributes: (list (list "COLSPAN" (number->string columns))) (nbsp) ) ) I'm outputting HTML, of course (well, -tsgml). I've tried various ways of defining the nbsp function. I tried each of the lines below separately, uncommenting exactly one each try. (define (nbsp) ;; (literal " ") ;; (make formatting-instruction data: " ") ;; (make formatting-instruction data: " ") ;; (literal "\no-break-space;") ;; (literal "\U-00A0;") ;; (literal "&#160;") ;; A (make formatting-instruction data: (string-append "&" "#160;")) ) In each case but the last two, the resulting file, when viewed via the "od" command or in Emacs, has a regular space there, not a non-breaking space. (For the third to work, I defined an entity nbsp via <!ENTITY nbsp "\U-00A0;" > ) Except for "A": it produced &#160;, presumably because it saw & (ampersand) was special and decided to escape it by keeping it an entity. That last one, though, worked. The empty table row above works, then. But I want to use non-breaking space in other places in my XML input. I can therefore use <nbsp/> in such places, declare an EMPTY entity "nbsp" in the DTD, and have "(element nbsp (nbsp))" in my code. Anyone see a nicer way? There's no magic Jade option -do-not-translate-nbsp-to-space, I suppose. With the entity method, I'll have to change my DTD to allow "nbsp" in any context where I care to use it. -- Tim McDaniel (home); Reply-To: tmcd@xxxxxxxxx; work is tmcd@xxxxxxxxxxx DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
(dsssl) Sort child elements by attr, Tim McDaniel | Thread | Re: (dsssl) Jade keeps translating , Holger Klawitter |
(dsssl) Sort child elements by attr, Tim McDaniel | Date | Re: (dsssl) Jade keeps translating , Holger Klawitter |
Month |