SGML ATTLIST - HTML4 DTD query

Discussion in 'HTML' started by rblah, Jan 17, 2004.

  1. rblah

    rblah Guest

    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
     
    rblah, Jan 17, 2004
    #1
    1. Advertising

  2. Toby A Inkster, Jan 17, 2004
    #2
    1. Advertising

  3. rblah <> wrote:

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

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Jan 17, 2004
    #3
  4. rblah

    Peter Flynn Guest

    Jukka K. Korpela wrote:

    > 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
     
    Peter Flynn, Jan 18, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alain Ketterlin

    ATTLIST id ID not working?

    Alain Ketterlin, Oct 1, 2003, in forum: XML
    Replies:
    4
    Views:
    561
    Eric Sirois
    Oct 3, 2003
  2. Clifford W. Racz
    Replies:
    4
    Views:
    2,036
    Clifford W. Racz
    Feb 13, 2004
  3. Martin Froehlich

    XML-Schema to (SGML) DTD transcription

    Martin Froehlich, Aug 6, 2004, in forum: XML
    Replies:
    2
    Views:
    426
    Peter Flynn
    Aug 7, 2004
  4. Martin Krallinger

    Parsing SGML given DTD using python

    Martin Krallinger, Jul 20, 2004, in forum: Python
    Replies:
    2
    Views:
    601
    Eric Brunel
    Jul 21, 2004
  5. Manfred Lotz

    ATTLIST and enumerations

    Manfred Lotz, Feb 24, 2014, in forum: XML
    Replies:
    4
    Views:
    292
    Peter Flynn
    Feb 27, 2014
Loading...

Share This Page