Subject: Re: Allowed characters in element id's From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx> Date: Thu, 30 Apr 1998 12:39:34 -0400 (EDT) |
At 30 Apr 1998 10:13 CDT, 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. Unfortunately, it's not something you can work out without some SGML background knowledge. The short answer is that the first character must be a letter, and any other characters may be a letter, a digit, ".", or "-". The long answer is that it's determined by the rules of SGML and by what's in your SGML Declaration. The characters allowed in an ID are those allowed in an SGML "NAME". By default, the first character must be a letter, and any other characters may be a letter or a digit. You can add to this by specifying the additional characters in your SGML Declaration (and you can't take any characters away). The convention in widest use is that of the "Reference concrete syntax" included in the SGML standard itself that adds "." and "-" as "name" characters (but not as "name start" characters). This is what's used in the DocBook SGML Declaration, docbook.dcl. The relevant portion is: ------------------------------------------------------------ NAMING LCNMSTRT "" UCNMSTRT "" LCNMCHAR ".-" UCNMCHAR ".-" NAMECASE GENERAL YES ENTITY NO ------------------------------------------------------------ The NAMING portion specifies both uppercase and lowercase forms of the additional "name start" and "name" characters (since names are folded to uppercase when the "GENERAL" parameter has the value YES"). > Is this something that can be changed, or is that not a wise thing to do? It can be changed by modifying your SGML Declaration, but doing so may hinder exchanging your documents with anybody else. Right now, you can send your DocBook documents to anybody else and they can use them (or you may need to send your customization DTD along as well), but if you modify your SGML Declaration, the person receiving your documents will have to have the modified SGML Declaration as well and be set up to use it, otherwise they'll get the error messages about the erroneous characters. 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Allowed characters in element i, Chuck Darney | Thread | Re: Allowed characters in element i, Bill Raynor |
Re: Allowed characters in element i, Chuck Darney | Date | Re: Allowed characters in element i, Bill Raynor |
Month |