Re: Is markup allowed in attribute values?

Eve L. Maler (
Fri, 28 Jun 1996 16:47:12 -0400

Message-Id: <>
Date: Fri, 28 Jun 1996 16:47:12 -0400
To: (Murray Altheim),
From: "Eve L. Maler" <>
Subject: Re: Is markup allowed in attribute values?
Cc: (Adam M. Costello),,

At 08:01 PM 6/26/96 -0500, Murray Altheim wrote:
>Here's a few types of attribute declarations you might find in a DTD:
>    NAME    The attribute contains a valid SGML NAME, which in HTML
>            consists of a valid name start character (a-z,A-Z) followed
>            by up to 71 alpha, numeric, hyphen and/or period characters.
>            No spaces allowed. The length is set by NAMELEN in the SGML
>            declaration.
>    NAMES   A space-delimited list of NAME tokens. The CLASS attribute
>            in i18n and the expired HTML 3.0 draft are declared as NAMES.
>    ID      A unique NAME. There are no ID attributes in the HTML 2.0
>            DTD, but the ID attribute in i18n is declared ID.
>    CDATA   Character Data that allows all valid SGML characters,
>            which should not be interpreted by the parser.
>    RCDATA  Similar to CDATA except that general and character entity
>            replacements should occur.
>    PCDATA  Parsed Character Data, allowing all valid SGML characters.
>            Within PCDATA, all markup (including start and end tags,
>            character and entity references, comments) is recognized
>            and processed accordingly.

This isn't quite correct.  You can specify NAME, NAMES, ID, and CDATA
(among others) as "declared values" for an attribute, but RCDATA and
PCDATA aren't allowed here; RCDATA can be used for element "declared 
content" (as can CDATA), and #PCDATA is used in element content models.
(The # must be used to distinguish the keyword from any element called

This is naturally confusing, because in attribute list declarations, 
CDATA as a declared value has the effect of  "replaceable character 
data" if the value has been put in quotes!


<!-- Eve Maler .............. ....... ArborText Inc. -->
<!-- Sponsor, Davenport ..... -->
<!-- Coauthor, Developing SGML DTDs: From Text to Model to Markup .... -->
<!-- ................. -->