(dsssl) Jade keeps translating non-breaking space to a regular space in HTML

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 "&#160;")
      ;; (make formatting-instruction data: "&#160;")
      ;; (make formatting-instruction data: "&nbsp;")
      ;; (literal "\no-break-space;")
      ;; (literal "\U-00A0;")
      ;; (literal "&#38;#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 &#38;#160;, presumably because it saw &#38
(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