SGML ATTLIST - HTML4 DTD query

R

rblah

Here's a question:

Why do they bother putting a:

<!ENTITY % attrs "%coreattrs; %i18n; %events;">

in the HTML4.01 strict DTD? (found at
http://www.w3.org/TR/REC-html40/strict.dtd)

Every instance of a %attrs in an <!ATTLIST is proceded with the
following comment:

-- %coreattrs, %i18n, %events --

I thought that the whole point behind the ENTITY was to reduce typing...
if they had decided to add a new attribute to the attrs ENTITY then
they'll have to pass the docbook through a script to update the comments!

It seems kind of pointless. Anyone care to comment?

Chris
 
J

Jukka K. Korpela

rblah said:
Why do they bother putting a:

<!ENTITY % attrs "%coreattrs; %i18n; %events;">

in the HTML4.01 strict DTD?

They think it acts a sort-of documentation.
Every instance of a %attrs in an <!ATTLIST is proceded with the
following comment:

-- %coreattrs, %i18n, %events --

Perhaps someone was paid by character count for writing the DTD. :)
I thought that the whole point behind the ENTITY was to reduce
typing...

In a sense it is. But it may also act as comment-like documentation.

After all, they also have e.g.

<!ENTITY % URI "CDATA"
-- a Uniform Resource Identifier,
see [URI]
-->

which might make people remember that although the SGML syntax is just

<!ATTLIST A
- -
href %URI; #IMPLIED -- URI for linked resource --

we are still supposed to use "URIs" (that's URLs, folx) and not
arbitrary strings as href values. On the other hand, such usage may
also mislead people into thinking that the declaration for href would
really _mean_ (as an SGML construct) something else than just
href CDATA #IMPLIED

The case with %attrs is a bit obscure. They wish to emphasize the role
of some attribues as "general attributes", so to say. But a DTD is
probably not the right place to do that. Very few people actually read
DTDs, and even fewer understand them (right).
 
P

Peter Flynn

Jukka said:
The case with %attrs is a bit obscure. They wish to emphasize the role
of some attribues as "general attributes", so to say. But a DTD is
probably not the right place to do that. Very few people actually read
DTDs, and even fewer understand them (right).

Yes, the breaking-up of a declaration into components represented by
parameter entities (and the subdivision of those into even more PEs)
is a useful practice for *managing* a large DTD. Both TEI and DocBook
do this precisely for this reason: it helps clarity of thought by the
*designer*. So in some ways a DTD is exactly the right place, in others
it's not.

Unfortunately, when the management of the HTML DTD passed from the
IETF to the W3C, some of the SGML DTD skills got lost in the process,
and in any event the HTML DTD became a football field for the match
between Microsoft and Netscape. I think Dave Raggett and his colleagues
did the best job they could in the circumstances, and as none of the
browsers use the DTDs anyway, it's all a bit irrelevant, as people don't
need to see or know any of the PEs in order to use the DTDs for
authoring (like, everyone is using XML nowadays, right? :)

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top