Re: Using Underscore "_" in Entity Names

Subject: Re: Using Underscore "_" in Entity Names
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Thu, 12 Feb 1998 11:11:41 -0500 (EST)
At 12 Feb 1998 09:34 -0500, Chuck Darney wrote:
 > Within my SGML instance I have several Text Entities referenced.  In the
 > header I have an Entity:
 > 
 > <!ENTITY QUOTE_EXPIRE_DT "June 25, 1997">
 > 
 > Later in the instance I reference "QUOTE_EXPIRE_DT".  
 > 
 > The underscores are not valid characters in the entity name.  Is this a
 > limitation with SGML or DSSSL?  Is there a way around it? I'm passing
 > these entity references from a Powerbuilder program and a SQL database
 > (which doesn't care for dashes).

It's controlled by your SGML Declaration, and, if you don't supply one
when you're parsing, an SGML system will infer one for you.

The specific portion of the SGML Declaration of interest here is the
"naming rules".  Jade's default inferred SGML Declaration uses the
same naming rules as SGML's "Reference Concrete Syntax".  To allow
underscores in entity names (and other SGML names), you need to supply
an SGML Declaration that includes the underscore character.  Using the
DocBook SGML Declaration as an example, you need to add "_" to the
LCNMSTRT and UCNMSTRT parameters:

	NAMING
		LCNMSTRT "_"
		UCNMSTRT "_"
		LCNMCHAR ".-"
		UCNMCHAR ".-"
		NAMECASE
			GENERAL YES
			ENTITY  NO

This will allow underscores anywhere in names, including as the first
character.  You need to add it in two places because you are declaring
the uppercase and lowercase forms, which just happen to be the same.

You can reference your SGML Declaration by including it in the Jade
command line before the filename for your SGML file (or before your
DTD if also including the DTD filename in the command line).  You can
also reference an SGML Declaration to infer by using the "SGMLDECL"
keyword in your catalog file.  (See "charset.htm" from the nsgmls
distribution for more information on the catalog format.)  However,
I'm not sure what would happen if you referenced an SGML Declaration
that used name characters and quantities, etc., that conflicted with
the requirements for processing the DSSSL stylesheet DTD.

Regards,


Tony Graham
=======================================================================
Tony Graham
Mulberry Technologies, Inc.                         Phone: 301-315-9632
17 West Jefferson Street, Suite 207                 Fax:   301-315-8285
Rockville, MD USA 20850                 email: tgraham@xxxxxxxxxxxxxxxx
=======================================================================


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Using Underscore "_" in Entity Names
    • Chuck Darney - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id JAA20783Thu, 12 Feb 1998 09:46:20 -0500 (EST)
      • John Fieber - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id KAA21941Thu, 12 Feb 1998 10:46:27 -0500 (EST)
      • Tony Graham - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id LAA22492Thu, 12 Feb 1998 11:12:01 -0500 (EST) <=
        • W. Eliot Kimber - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id LAA22820Thu, 12 Feb 1998 11:27:07 -0500 (EST)