Re: nbsp in Jade

Subject: Re: nbsp in Jade
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Thu, 27 Aug 1998 11:31:53 -0400 (EDT)
At 26 Aug 1998 16:26 +0100, Pawson, David wrote:
 > Is there an 'entity->character' function
 > (of some description).
 > sounds a bit daft, because surely that's what Jade does?

None that I know of.

 > In this usage, Jade moaned if I tried the standard 
 > entity defn from isonum.ent.
 > What's the alternative (assuming there is one and
 > I don't know where to find it - the normal case :-(

Reference the character by name.  Use the Unicode character name
converted to lowercase, and replace spaces with dashes:

   NO-BREAK SPACE --> #\no-break-space

Jade doesn't handle every character name, but it does map
#\no-break-space (I checked).

 > Also, since I was using the entity (or failing to)
 > in Jade, is the style-sheet.dtd the right place to 
 > put an entity that I want to use in the style sheet?

You can put this in the internal subset of your DOCTYPE declaration:

<!ENTITY nbsp "#\no-break-space">

Note that if you use this &nbsp; entity inside a string, you'll get an
extra "#", and you'll get errors if the entity is immediately followed
by one or more name characters.  The same character in a string would
be represented as "\no-break-space;" (although the ";" can be omitted
if the character reference is followed by a character that cannot be
used in a name, e.g. by a space).


Tony Graham
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

 DSSSList info and archive:

Current Thread
  • nbsp in Jade
    • Pawson, David - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id OAA03436Wed, 26 Aug 1998 14:13:40 -0400 (EDT)
      • Tony Graham - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id LAA10783Thu, 27 Aug 1998 11:34:05 -0400 (EDT) <=