Re: Allowed characters in element id's

Subject: Re: Allowed characters in element id's
From: Chuck Darney <cdarney@xxxxxxxxxxxxxxxx>
Date: Thu, 30 Apr 1998 11:57:04 -0400
I had a similar problem a little while ago.  This was the response I
got.  It did very well.

....Chuck Darney

Bill Raynor wrote:
> 
> How do I determine what's allowed in an id= attribute? I'd like to use
> underscores and periods but jade gets upset about extraneous punctuation
> marks in the id. I'm generating the sgml from another system and would
> like to take give the elements an easy to read name.
> 
> Is this something that can be changed, or is that not a wise thing to do?
> --




> 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


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


Current Thread
  • Allowed characters in element id's
    • Bill Raynor - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id LAA23976Thu, 30 Apr 1998 11:19:37 -0400 (EDT)
      • Norman Walsh - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id LAA24496Thu, 30 Apr 1998 11:41:50 -0400 (EDT)
        • Bill Raynor - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id MAA25255Thu, 30 Apr 1998 12:00:16 -0400 (EDT)
      • Henry Thompson - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id LAA24863Thu, 30 Apr 1998 11:50:37 -0400 (EDT)
      • Chuck Darney - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id MAA25493Thu, 30 Apr 1998 12:08:36 -0400 (EDT) <=
      • Tony Graham - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id MAA26656Thu, 30 Apr 1998 12:46:46 -0400 (EDT)
        • Bill Raynor - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id NAA27831Thu, 30 Apr 1998 13:51:15 -0400 (EDT)
      • <Possible follow-ups>
      • W. Eliot Kimber - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id MAA25492Thu, 30 Apr 1998 12:08:35 -0400 (EDT)
      • W. Eliot Kimber - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id OAA28591Thu, 30 Apr 1998 14:31:11 -0400 (EDT)