|
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
old-postcode)))
(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
"\no-break-space;".
-dan
--
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: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| non breaking spaces, Pawson, David | Thread | Re: record ends, W. Eliot Kimber |
| non breaking spaces, Pawson, David | Date | Re: non breaking spaces, Paul Prescod |
| Month |