Re: non breaking spaces

Subject: Re: non breaking spaces
From: Daniel Speck <dspeck@xxxxxxx>
Date: Mon, 24 Aug 1998 12:10:42 -0400

Pawson, David wrote:

> Is it possible to create a source SGML document marked up in such a way
> as to 'keep together' two words in the output? They are within the same
> element.

> name adsl1 adsl2 adsl3 town county country postcode, e.g.  PE2 6SJ.
> They are wanted laid out on a single line as shown.
> Can I either
> a) insert an entity or similar in the database source
> b) Do anything in the stylesheet,

Yes to both questions. You probably don't want to have to modify your database
entries but you could change the space in the postcode field to be the ISO
Numeric and Special Graphic character entity for a non-breaking space, i.e.,

What you really should do is modify the DSSSL style sheet to enforce your
typographic requirements. A line-field flow object might be suited to this
task but the RTF backend only supports line-fields that occur at the start of
a paragraph. There might be a property on the character flow object that says,
in effect, keep all of these characters on the same line (I'm not sure, I
don't have my copy of the DSSSL standard handy). An alternative would be to
replace the space in the postcode field with a non-breaking space in an
element rule:

(element (postcode)
  (let* ((old-postcode (data (current-node)))
           (new-postcode (replace-space-with-non-breaking-space
  (literal new-postcode)))

The function (replace-space-with-non-breaking-space str) would take a string
and iterate through it replacing any occurrence of  " " with


Daniel Speck
Bureau of National Affairs, Inc.               Voice: +1 202.452.6596
1231 25th Street, NW                             Fax: +1 202.331.5178
Washington, DC 20037                          e-mail:  dspeck@xxxxxxx

 DSSSList info and archive:

Current Thread
  • non breaking spaces
    • Pawson, David - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id LAA18239Mon, 24 Aug 1998 11:00:27 -0400 (EDT)
      • Daniel Speck - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id MAA24809Mon, 24 Aug 1998 12:15:06 -0400 (EDT) <=
        • W. Eliot Kimber - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id VAA29834Mon, 24 Aug 1998 21:51:57 -0400 (EDT)
      • Paul Prescod - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id RAA17060Mon, 24 Aug 1998 17:16:36 -0400 (EDT)