Re: Is markup allowed in attribute values?

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
"pcdata".)

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

<!-- Eve Maler .............. elm@arbortext.com ....... ArborText Inc. -->
<!-- Sponsor, Davenport ..... http://www.ora.com/davenport/README.html -->
<!-- Coauthor, Developing SGML DTDs: From Text to Model to Markup .... -->
<!-- http://www.prenhall.com/013/309880/30988-0.html ................. -->

Received on Friday, 28 June 1996 18:04:09 UTC